-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
152 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Api | ||
module V1 | ||
class CultureTypesController < ApiController | ||
def index | ||
render_paginated CultureType.all | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class CultureType < ApplicationRecord | ||
validates :name, presence: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class CultureTypeSerializer < ActiveModel::Serializer | ||
attributes :id, :name, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class CreateCultureTypes < ActiveRecord::Migration[5.1] | ||
def change | ||
create_table :culture_types do |t| | ||
t.string :name | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name | ||
Culture Type Original | ||
AEROBIC | ||
Aerobic culture | ||
Anaerobic culture | ||
Bacterial Aerobic | ||
Bacterial Culture | ||
Bacterial Culture, Blood | ||
Bacterial Culture/Smear (Aerobic) | ||
Bacterial Culture/Smear (Aerobic/Anaerobic) | ||
Bacterial Stool Culture/NAT | ||
Bacterial Stool Nucleic Acid Test | ||
Bacterial/Yeast Culture, Blood | ||
Blood - Culture & Sensitivity | ||
Blood anaerobic | ||
Blood culture | ||
BLOOD CULTURE & SUSCEPTIBILITY (BACTEC) | ||
Body Fluid - Culture & Sensitivity | ||
Body fluid culture | ||
Catheter Tip Culture & Sensitivity | ||
Central Line Tip for Culture & Sensitivity | ||
CSF Culture & Sensitivity | ||
CSF Culture and gram stain | ||
Culture & Sensitivity | ||
CULTURE AEROBIC | ||
CULTURE AEROBIC & SUSCEPTIBILITY | ||
CULTURE ANAEROBIC | ||
Culture and gram stain | ||
Culture and Sensitivity | ||
CULTURE STOOL | ||
CULTURE SURVEILLANCE, MRSA | ||
Culture Urine | ||
CULTURE URINE WITH SUSCEPTIBILITY | ||
Cystic Fibrosis Respiratory Culture | ||
Fungal Culture | ||
Gonococcus Culture | ||
Group B Streptococcus Susceptibility | ||
High Vaginal Swab Culture and Sensitivity | ||
HVS Culture for Group B streptococcus | ||
MRSA Surveillance Culture | ||
Organism Identification and Susceptibility | ||
Other (specify in additional information) | ||
Paired Blood Culture & Sensitivity | ||
Peritoneal Fluid Culture & Sensitivity | ||
Pleural Fluid Culture & Sensitivity | ||
Pus Culture & Sensitivity | ||
Quantitative Culture Tissue | ||
Respiratory Culture and Smear | ||
Respiratory Surveillance Culture | ||
Skin Culture & Sensitivity | ||
Specimen source not given | ||
Sputum culture | ||
Sputum Culture & Sensitivity | ||
Stool Culture | ||
Stool Culture & Sensitivity | ||
Stool ID AND SENSITIVITY | ||
Surveillance Culture | ||
Susceptibility | ||
Throat culture | ||
Throat Swab Culture & Sensitivity | ||
Tip Culture & Sensitivity | ||
Tissue Culture & Sensitivity | ||
Tracheal Secretions Culture & Sensitivity | ||
Urine culture | ||
Urine Culture & Sensitivity | ||
Wound ID AND SENSITIVITY | ||
Wound Swab Culture & Sensitivity | ||
Yeast Identification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Api::V1::CultureTypesController, type: :controller do | ||
describe 'GET /culture_types' do | ||
context 'with an unauthenticated user' do | ||
before { get :index } | ||
|
||
it 'should respond unauthorized' do | ||
expect(response).to have_http_status(:unauthorized) | ||
end | ||
end | ||
|
||
context 'with an authenticated user' do | ||
let(:user) { create :user } | ||
let!(:culture_types) { create_list :culture_type, 10 } | ||
before do | ||
authenticate(user) | ||
get :index | ||
end | ||
|
||
it 'responds ok' do | ||
expect(response).to have_http_status(:ok) | ||
end | ||
|
||
it_behaves_like 'a paginated request', CultureType.all | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FactoryBot.define do | ||
factory :culture_type do | ||
name { FFaker::HealthcareIpsum.word } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe CultureType, type: :model do | ||
subject { build :culture_type } | ||
|
||
it { is_expected.to validate_presence_of(:name) } | ||
|
||
it { is_expected.to be_valid } | ||
end |