renalware-core 2.0.0.pre.beta6 → 2.0.0.pre.beta7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -0
- data/lib/renalware/version.rb +1 -1
- data/spec/factories/accesses/patients.rb +3 -0
- data/spec/factories/accesses/plans.rb +11 -0
- data/spec/factories/accesses/plans_types.rb +5 -0
- data/spec/factories/accesses/procedures.rb +7 -0
- data/spec/factories/accesses/profiles.rb +14 -0
- data/spec/factories/accesses/sites.rb +6 -0
- data/spec/factories/accesses/types.rb +8 -0
- data/spec/factories/clinical/allergies.rb +7 -0
- data/spec/factories/clinical/body_compositions.rb +23 -0
- data/spec/factories/clinical/dry_weights.rb +11 -0
- data/spec/factories/clinical/patients.rb +3 -0
- data/spec/factories/clinics/appointments.rb +8 -0
- data/spec/factories/clinics/clinic_visits.rb +16 -0
- data/spec/factories/clinics/clinics.rb +6 -0
- data/spec/factories/deaths/cause.rb +6 -0
- data/spec/factories/deaths/modality_descriptions.rb +5 -0
- data/spec/factories/directory/people.rb +9 -0
- data/spec/factories/drugs/drug.rb +5 -0
- data/spec/factories/drugs/drug_types.rb +6 -0
- data/spec/factories/events/events.rb +26 -0
- data/spec/factories/events/events_types.rb +16 -0
- data/spec/factories/hd/cannulation_types.rb +5 -0
- data/spec/factories/hd/dialysers.rb +6 -0
- data/spec/factories/hd/hd_session_document.rb +69 -0
- data/spec/factories/hd/modality_descriptions.rb +5 -0
- data/spec/factories/hd/patient_statistics.rb +8 -0
- data/spec/factories/hd/patients.rb +3 -0
- data/spec/factories/hd/preference_sets.rb +10 -0
- data/spec/factories/hd/profiles.rb +18 -0
- data/spec/factories/hd/sessions.rb +34 -0
- data/spec/factories/hd/stations.rb +5 -0
- data/spec/factories/hospitals/centres.rb +6 -0
- data/spec/factories/hospitals/units.rb +15 -0
- data/spec/factories/letters/archives.rb +5 -0
- data/spec/factories/letters/contact_descriptions.rb +16 -0
- data/spec/factories/letters/contacts.rb +5 -0
- data/spec/factories/letters/descriptions.rb +5 -0
- data/spec/factories/letters/letterheads.rb +10 -0
- data/spec/factories/letters/letters.rb +25 -0
- data/spec/factories/letters/patients.rb +3 -0
- data/spec/factories/letters/primary_care_physicians.rb +5 -0
- data/spec/factories/letters/recipients.rb +11 -0
- data/spec/factories/medications/medication_route.rb +11 -0
- data/spec/factories/medications/prescription.rb +17 -0
- data/spec/factories/medications/prescription_terminations.rb +7 -0
- data/spec/factories/medications/prescription_version.rb +4 -0
- data/spec/factories/messaging/authors.rb +5 -0
- data/spec/factories/messaging/message.rb +11 -0
- data/spec/factories/messaging/patients.rb +5 -0
- data/spec/factories/messaging/receipt.rb +7 -0
- data/spec/factories/messaging/recipients.rb +5 -0
- data/spec/factories/modalities/modalities.rb +27 -0
- data/spec/factories/modalities/modality_descriptions.rb +34 -0
- data/spec/factories/modalities/modality_reasons.rb +20 -0
- data/spec/factories/pathology/consultant.rb +3 -0
- data/spec/factories/pathology/lab.rb +5 -0
- data/spec/factories/pathology/measurement_units.rb +8 -0
- data/spec/factories/pathology/observation_descriptions.rb +7 -0
- data/spec/factories/pathology/observation_requests.rb +8 -0
- data/spec/factories/pathology/observations.rb +8 -0
- data/spec/factories/pathology/patients.rb +3 -0
- data/spec/factories/pathology/request_descriptions.rb +6 -0
- data/spec/factories/pathology/requests/drug_category.rb +6 -0
- data/spec/factories/pathology/requests/global_rule.rb +7 -0
- data/spec/factories/pathology/requests/global_rule_set.rb +6 -0
- data/spec/factories/pathology/requests/patient_rule.rb +13 -0
- data/spec/factories/pathology/requests/request.rb +10 -0
- data/spec/factories/patients/alerts.rb +8 -0
- data/spec/factories/patients/bookmarks.rb +6 -0
- data/spec/factories/patients/ethnicities.rb +6 -0
- data/spec/factories/patients/languages.rb +5 -0
- data/spec/factories/patients/patients.rb +32 -0
- data/spec/factories/patients/practices.rb +17 -0
- data/spec/factories/patients/primary_care_physicians.rb +21 -0
- data/spec/factories/patients/religions.rb +5 -0
- data/spec/factories/patients/users.rb +3 -0
- data/spec/factories/pd/assessments.rb +22 -0
- data/spec/factories/pd/bag_types.rb +17 -0
- data/spec/factories/pd/episode_types.rb +6 -0
- data/spec/factories/pd/exit_site_infections.rb +9 -0
- data/spec/factories/pd/fluid_descriptions.rb +6 -0
- data/spec/factories/pd/infection_organisms.rb +10 -0
- data/spec/factories/pd/modality_descriptions.rb +5 -0
- data/spec/factories/pd/organism_codes.rb +6 -0
- data/spec/factories/pd/patients.rb +3 -0
- data/spec/factories/pd/pd_regimes.rb +36 -0
- data/spec/factories/pd/peritonitis_episode_type_descriptions.rb +8 -0
- data/spec/factories/pd/peritonitis_episodes.rb +20 -0
- data/spec/factories/pd/pet_adequacies.rb +38 -0
- data/spec/factories/pd/regime_bags.rb +44 -0
- data/spec/factories/pd/systems.rb +11 -0
- data/spec/factories/pd/training_sessions.rb +16 -0
- data/spec/factories/pd/training_sites.rb +6 -0
- data/spec/factories/pd/training_types.rb +5 -0
- data/spec/factories/problems/problems.rb +7 -0
- data/spec/factories/renal/patients.rb +3 -0
- data/spec/factories/renal/prd_description.rb +6 -0
- data/spec/factories/renal/profiles.rb +5 -0
- data/spec/factories/reporting/audits.rb +8 -0
- data/spec/factories/snippets/snippets.rb +6 -0
- data/spec/factories/snippets/users.rb +4 -0
- data/spec/factories/system/addresses.rb +11 -0
- data/spec/factories/system/roles.rb +27 -0
- data/spec/factories/system/templates.rb +15 -0
- data/spec/factories/system/users.rb +58 -0
- data/spec/factories/transplants/donations.rb +8 -0
- data/spec/factories/transplants/donor_stage.rb +12 -0
- data/spec/factories/transplants/donor_stage_position.rb +5 -0
- data/spec/factories/transplants/donor_stage_status.rb +5 -0
- data/spec/factories/transplants/live_donor_modality_description.rb +6 -0
- data/spec/factories/transplants/modality_descriptions.rb +10 -0
- data/spec/factories/transplants/patients.rb +3 -0
- data/spec/factories/transplants/recipient_followups.rb +4 -0
- data/spec/factories/transplants/recipient_operations.rb +15 -0
- data/spec/factories/transplants/registration_status_descriptions.rb +7 -0
- data/spec/factories/transplants/registration_statuses.rb +9 -0
- data/spec/factories/transplants/registrations.rb +46 -0
- data/spec/support/capybara_helper.rb +9 -0
- data/spec/support/database_cleaner.rb +18 -0
- data/spec/support/date_helpers.rb +9 -0
- data/spec/support/devise_spec_helper.rb +29 -0
- data/spec/support/drugs_spec_helper.rb +49 -0
- data/spec/support/factory_girl.rb +29 -0
- data/spec/support/json_helpers.rb +5 -0
- data/spec/support/letters_spec_helper.rb +36 -0
- data/spec/support/login_macros.rb +26 -0
- data/spec/support/matchers/document.rb +5 -0
- data/spec/support/matchers/validate_timeliness_of.rb +16 -0
- data/spec/support/pathology_spec_helper.rb +37 -0
- data/spec/support/patients_spec_helper.rb +16 -0
- data/spec/support/poltergeist.rb +2 -0
- data/spec/support/pundit_matcher.rb +13 -0
- data/spec/support/roles_spec_helper.rb +7 -0
- data/spec/support/select2_spec_helper.rb +13 -0
- data/spec/support/select_date_spec_helper.rb +11 -0
- data/spec/support/shared_contexts/a_global_rule_set.rb +19 -0
- data/spec/support/translations.rb +12 -0
- data/spec/support/travel.rb +7 -0
- data/spec/support/webmock.rb +3 -0
- metadata +142 -58
- data/vendor/xsd/ukrdc/README.md +0 -9
- data/vendor/xsd/ukrdc/Schema/Allergies/Allergy.xsd +0 -69
- data/vendor/xsd/ukrdc/Schema/ClinicalRelationships/ClinicalRelationship.xsd +0 -27
- data/vendor/xsd/ukrdc/Schema/Diagnoses/CauseOfDeath.xsd +0 -32
- data/vendor/xsd/ukrdc/Schema/Diagnoses/Diagnosis.xsd +0 -41
- data/vendor/xsd/ukrdc/Schema/Diagnoses/RenalDiagnosis.xsd +0 -41
- data/vendor/xsd/ukrdc/Schema/Documents/Document.xsd +0 -72
- data/vendor/xsd/ukrdc/Schema/Encounters/Encounter.xsd +0 -121
- data/vendor/xsd/ukrdc/Schema/Encounters/TransplantList.xsd +0 -108
- data/vendor/xsd/ukrdc/Schema/Encounters/Treatment.xsd +0 -207
- data/vendor/xsd/ukrdc/Schema/FamilyHistories/FamilyHistory.xsd +0 -42
- data/vendor/xsd/ukrdc/Schema/LabOrders/LabOrder.xsd +0 -181
- data/vendor/xsd/ukrdc/Schema/Medications/Medication.xsd +0 -88
- data/vendor/xsd/ukrdc/Schema/Observations/Observation.xsd +0 -65
- data/vendor/xsd/ukrdc/Schema/Patient.xsd +0 -87
- data/vendor/xsd/ukrdc/Schema/Procedures/DialysisSession.xsd +0 -61
- data/vendor/xsd/ukrdc/Schema/Procedures/Procedure.xsd +0 -38
- data/vendor/xsd/ukrdc/Schema/Procedures/Transplant.xsd +0 -160
- data/vendor/xsd/ukrdc/Schema/Procedures/VascularAccess.xsd +0 -49
- data/vendor/xsd/ukrdc/Schema/ProgramMemberships/ProgramMembership.xsd +0 -46
- data/vendor/xsd/ukrdc/Schema/README.md +0 -1
- data/vendor/xsd/ukrdc/Schema/SocialHistories/SocialHistory.xsd +0 -15
- data/vendor/xsd/ukrdc/Schema/Surveys/Survey.xsd +0 -143
- data/vendor/xsd/ukrdc/Schema/Types/ActionCode.xsd +0 -37
- data/vendor/xsd/ukrdc/Schema/Types/Address.xsd +0 -67
- data/vendor/xsd/ukrdc/Schema/Types/CF_DMD.xsd +0 -27
- data/vendor/xsd/ukrdc/Schema/Types/CF_EDTA_COD.xsd +0 -343
- data/vendor/xsd/ukrdc/Schema/Types/CF_EDTA_PRD.xsd +0 -356
- data/vendor/xsd/ukrdc/Schema/Types/CF_HL7_0004.xsd +0 -76
- data/vendor/xsd/ukrdc/Schema/Types/CF_HL7_00204.xsd +0 -46
- data/vendor/xsd/ukrdc/Schema/Types/CF_HL7_00206.xsd +0 -41
- data/vendor/xsd/ukrdc/Schema/Types/CF_RR1.xsd +0 -567
- data/vendor/xsd/ukrdc/Schema/Types/CF_RR23.xsd +0 -82
- data/vendor/xsd/ukrdc/Schema/Types/CF_RR7_Discharge.xsd +0 -80
- data/vendor/xsd/ukrdc/Schema/Types/CF_RR7_Treatment.xsd +0 -241
- data/vendor/xsd/ukrdc/Schema/Types/CF_SNOMED.xsd +0 -27
- data/vendor/xsd/ukrdc/Schema/Types/Clinician.xsd +0 -27
- data/vendor/xsd/ukrdc/Schema/Types/CodeTableDetail.xsd +0 -27
- data/vendor/xsd/ukrdc/Schema/Types/CodedField.xsd +0 -27
- data/vendor/xsd/ukrdc/Schema/Types/CommonMetadata.xsd +0 -23
- data/vendor/xsd/ukrdc/Schema/Types/ContactDetail.xsd +0 -55
- data/vendor/xsd/ukrdc/Schema/Types/DrugProduct.xsd +0 -41
- data/vendor/xsd/ukrdc/Schema/Types/EthnicGroup.xsd +0 -114
- data/vendor/xsd/ukrdc/Schema/Types/FamilyDoctor.xsd +0 -21
- data/vendor/xsd/ukrdc/Schema/Types/LabResultItem.xsd +0 -160
- data/vendor/xsd/ukrdc/Schema/Types/LabTestItem.xsd +0 -24
- data/vendor/xsd/ukrdc/Schema/Types/Language.xsd +0 -981
- data/vendor/xsd/ukrdc/Schema/Types/Location.xsd +0 -27
- data/vendor/xsd/ukrdc/Schema/Types/NV_RR14.xsd +0 -39
- data/vendor/xsd/ukrdc/Schema/Types/Name.xsd +0 -51
- data/vendor/xsd/ukrdc/Schema/Types/Occupation.xsd +0 -75
- data/vendor/xsd/ukrdc/Schema/Types/Order.xsd +0 -48
- data/vendor/xsd/ukrdc/Schema/Types/PatientNumber.xsd +0 -90
- data/vendor/xsd/ukrdc/Schema/Types/PersonalContactType.xsd +0 -11
- data/vendor/xsd/ukrdc/Schema/Types/Result.xsd +0 -178
- data/vendor/xsd/ukrdc/Schema/UKRDC.xsd +0 -148
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45b6a3aae38e2bb5cf1f105577622755367bdabb
|
|
4
|
+
data.tar.gz: cf3152a078fcca9432a71205f8c6272499b42d8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bb61647bfbb4cf91c7e45138c165dc7a8d38c0205c2d4541dee5f32e8dc45663b9a8ac16e25e11ef73e33d2743674a1797f3914ddcf3e6bd1bed342de6151cd
|
|
7
|
+
data.tar.gz: f8a21c784e7394d2ae5fb9bbfa215bbe4a0d5e09a135b9012a522b258cf8418c0bc182a8c00a419fa27cae01f178f68d9d1865d0fc89edc860629d849e0650f8
|
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2016 Airslie Ltd
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/renalware/version.rb
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :access_plan, class: Renalware::Accesses::Plan do
|
|
3
|
+
association :patient, factory: :accesses_patient
|
|
4
|
+
association :plan_type, factory: :access_plan_type
|
|
5
|
+
notes "Lorem ipsum dolor sit amet.."
|
|
6
|
+
created_by { Renalware::User.first || create(:user) }
|
|
7
|
+
updated_by { Renalware::User.first || create(:user) }
|
|
8
|
+
decided_by { Renalware::User.first || create(:user) }
|
|
9
|
+
terminated_at nil
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :access_profile, class: Renalware::Accesses::Profile do
|
|
3
|
+
patient
|
|
4
|
+
type { create(:access_type) }
|
|
5
|
+
side :right
|
|
6
|
+
formed_on { Time.zone.today }
|
|
7
|
+
association :created_by, factory: :user
|
|
8
|
+
association :updated_by, factory: :user
|
|
9
|
+
|
|
10
|
+
trait :current do
|
|
11
|
+
started_on { 1.day.ago }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :body_composition, class: "Renalware::Clinical::BodyComposition" do
|
|
3
|
+
patient
|
|
4
|
+
|
|
5
|
+
assessed_on 1.week.ago
|
|
6
|
+
overhydration "19.1"
|
|
7
|
+
volume_of_distribution "52.1"
|
|
8
|
+
total_body_water "23.1"
|
|
9
|
+
extracellular_water "63.1"
|
|
10
|
+
intracellular_water "23.1"
|
|
11
|
+
lean_tissue_index "78.1"
|
|
12
|
+
fat_tissue_index "32.1"
|
|
13
|
+
lean_tissue_mass "32.1"
|
|
14
|
+
fat_tissue_mass "42.1"
|
|
15
|
+
adipose_tissue_mass "15.1"
|
|
16
|
+
body_cell_mass "53.1"
|
|
17
|
+
quality_of_reading "65.123"
|
|
18
|
+
|
|
19
|
+
association :assessor, factory: :user
|
|
20
|
+
association :created_by, factory: :user
|
|
21
|
+
association :updated_by, factory: :user
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :dry_weight, class: "Renalware::Clinical::DryWeight" do
|
|
3
|
+
patient
|
|
4
|
+
|
|
5
|
+
assessed_on 1.week.ago
|
|
6
|
+
weight 156.1
|
|
7
|
+
association :assessor, factory: :user
|
|
8
|
+
association :created_by, factory: :user
|
|
9
|
+
association :updated_by, factory: :user
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :clinic_visit, class: "Renalware::Clinics::ClinicVisit" do
|
|
3
|
+
patient
|
|
4
|
+
date Time.zone.today
|
|
5
|
+
time Time.zone.now
|
|
6
|
+
did_not_attend false
|
|
7
|
+
height 1725
|
|
8
|
+
weight 6985
|
|
9
|
+
pulse 100
|
|
10
|
+
systolic_bp 112
|
|
11
|
+
diastolic_bp 71
|
|
12
|
+
clinic
|
|
13
|
+
association :created_by, factory: :user
|
|
14
|
+
association :updated_by, factory: :user
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :directory_person, class: "Renalware::Directory::Person" do
|
|
3
|
+
given_name { Faker::Name.first_name }
|
|
4
|
+
family_name { Faker::Name.last_name }
|
|
5
|
+
title { Faker::Name.prefix }
|
|
6
|
+
association :created_by, factory: :user
|
|
7
|
+
association :updated_by, factory: :user
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :event, class: "Renalware::Events::Event" do
|
|
3
|
+
patient
|
|
4
|
+
event_type factory: :events_type
|
|
5
|
+
date_time Time.zone.now
|
|
6
|
+
description "Needs blood sample taken."
|
|
7
|
+
notes "Would like son to accompany them on clinic visit."
|
|
8
|
+
association :created_by, factory: :user
|
|
9
|
+
association :updated_by, factory: :user
|
|
10
|
+
|
|
11
|
+
factory :simple_event, class: "Renalware::Events::Simple" do
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
factory :swab, class: "Renalware::Events::Swab" do
|
|
16
|
+
event_type factory: :swab_event_type
|
|
17
|
+
document {
|
|
18
|
+
{
|
|
19
|
+
type: Renalware::Events::Swab::Document.type.values.first,
|
|
20
|
+
result: Renalware::Events::Swab::Document.result.values.first,
|
|
21
|
+
location: "The location"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :events_type, class: "Renalware::Events::Type" do
|
|
3
|
+
name "Access--Clinic"
|
|
4
|
+
|
|
5
|
+
factory :swab_event_type do
|
|
6
|
+
name "Swab"
|
|
7
|
+
event_class_name "Renalware::Events::Swab"
|
|
8
|
+
slug "swabs"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
factory :pd_line_change_event_type do
|
|
12
|
+
name "PD Line Change"
|
|
13
|
+
slug "pd_line_changes"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# A word about using FactoryGirl to build document (jsonb) objects:
|
|
2
|
+
#
|
|
3
|
+
# The best solution I can find is to use OpenStructs to build each
|
|
4
|
+
# nested part, compose these in the top level document (e.g. SessionDocument)
|
|
5
|
+
# using `strategy: :marshal_dump`.
|
|
6
|
+
# When consuming in an AR-based factory, uses an after_build callback for example
|
|
7
|
+
#
|
|
8
|
+
# Factory :hd_closed_session, class: "Renalware::HD::Session::Closed" do
|
|
9
|
+
# after(:build) do |session|
|
|
10
|
+
# session.document = build(:hd_session_document).marshal_dump
|
|
11
|
+
# end
|
|
12
|
+
# end
|
|
13
|
+
#
|
|
14
|
+
# The support/factory_girl.rb for the definition of MarshalDumpStrategy
|
|
15
|
+
#
|
|
16
|
+
FactoryGirl.define do
|
|
17
|
+
factory :blood_pressure, class: OpenStruct do
|
|
18
|
+
systolic 100
|
|
19
|
+
diastolic 80
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
factory :hd_session_document_info, class: OpenStruct do
|
|
23
|
+
hd_type "hd"
|
|
24
|
+
machine_no 222
|
|
25
|
+
access_side "right"
|
|
26
|
+
access_type "Arteriovenous graft (AVG)"
|
|
27
|
+
access_type_abbreviation "AVG"
|
|
28
|
+
access_confirmed true
|
|
29
|
+
single_needle "no"
|
|
30
|
+
lines_reversed "no"
|
|
31
|
+
fistula_plus_line "no"
|
|
32
|
+
dialysis_fluid_used "a10"
|
|
33
|
+
is_access_first_use "no"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
factory :hd_session_document_dialysis, class: OpenStruct do
|
|
37
|
+
flow_rate 200
|
|
38
|
+
blood_flow 150
|
|
39
|
+
machine_ktv 1.0
|
|
40
|
+
machine_urr 1
|
|
41
|
+
fluid_removed 1.0
|
|
42
|
+
venous_pressure 1
|
|
43
|
+
litres_processed 1.0
|
|
44
|
+
arterial_pressure 1
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
factory :hd_session_document_observations_before, class: OpenStruct do
|
|
48
|
+
pulse 37
|
|
49
|
+
weight 100.0
|
|
50
|
+
bm_stix 1.0
|
|
51
|
+
temperature 36.0
|
|
52
|
+
blood_pressure factory: :blood_pressure, strategy: :marshal_dump
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
factory :hd_session_document_observations_after, class: OpenStruct do
|
|
56
|
+
pulse 36
|
|
57
|
+
weight 99.0
|
|
58
|
+
bm_stix 0.9
|
|
59
|
+
temperature 35.0
|
|
60
|
+
blood_pressure factory: :blood_pressure, strategy: :marshal_dump
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
factory :hd_session_document, class: OpenStruct do
|
|
64
|
+
info factory: :hd_session_document_info, strategy: :marshal_dump
|
|
65
|
+
dialysis factory: :hd_session_document_dialysis, strategy: :marshal_dump
|
|
66
|
+
observations_before factory: :hd_session_document_observations_before, strategy: :marshal_dump
|
|
67
|
+
observations_after factory: :hd_session_document_observations_after, strategy: :marshal_dump
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :hd_preference_set, class: "Renalware::HD::PreferenceSet" do
|
|
3
|
+
patient
|
|
4
|
+
association :hospital_unit, factory: :hospital_unit
|
|
5
|
+
schedule :mon_wed_fri_pm
|
|
6
|
+
other_schedule ""
|
|
7
|
+
association :created_by, factory: :user
|
|
8
|
+
association :updated_by, factory: :user
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :hd_profile, class: "Renalware::HD::Profile" do
|
|
3
|
+
patient
|
|
4
|
+
active true
|
|
5
|
+
association :hospital_unit, factory: :hospital_unit
|
|
6
|
+
association :prescriber, factory: :user
|
|
7
|
+
association :created_by, factory: :user
|
|
8
|
+
association :updated_by, factory: :user
|
|
9
|
+
|
|
10
|
+
document {
|
|
11
|
+
{
|
|
12
|
+
dialysis: {
|
|
13
|
+
hd_type: :hd
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :hd_session, class: "Renalware::HD::Session::Open" do
|
|
3
|
+
association :patient, factory: :hd_patient
|
|
4
|
+
association :hospital_unit, factory: :hospital_unit
|
|
5
|
+
association :signed_on_by, factory: :user
|
|
6
|
+
association :created_by, factory: :user
|
|
7
|
+
|
|
8
|
+
performed_on 1.week.ago
|
|
9
|
+
notes "Some notes"
|
|
10
|
+
|
|
11
|
+
factory :hd_open_session do
|
|
12
|
+
start_time "11:00"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
factory :hd_dna_session, class: "Renalware::HD::Session::DNA" do
|
|
16
|
+
document {
|
|
17
|
+
{
|
|
18
|
+
patient_on_holiday: "yes"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
factory :hd_closed_session, class: "Renalware::HD::Session::Closed" do
|
|
24
|
+
start_time "11:00"
|
|
25
|
+
end_time "16:00"
|
|
26
|
+
signed_off_at { 1.day.ago }
|
|
27
|
+
association :signed_off_by, factory: :user
|
|
28
|
+
|
|
29
|
+
after(:build) do |session|
|
|
30
|
+
session.document = build(:hd_session_document).marshal_dump
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|