mml-ruby 0.0.2 → 0.0.3
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.
- data/LICENSE +199 -10
- data/lib/mml.rb +288 -5
- data/lib/mml/common.rb +26 -268
- data/lib/mml/version.rb +1 -1
- data/lib/xml/address.xml.builder +12 -0
- data/lib/xml/baseclinic.xml.builder +36 -0
- data/lib/xml/creatorinfo.xml.builder +6 -0
- data/lib/xml/creatorlicense.xml.builder +3 -0
- data/lib/xml/department.xml.builder +8 -0
- data/lib/xml/extref.xml.builder +5 -0
- data/lib/xml/facility.xml.builder +8 -0
- data/lib/xml/firstclinic.xml.builder +47 -0
- data/lib/xml/id.xml.builder +4 -0
- data/lib/xml/insurance.xml.builder +82 -0
- data/lib/xml/lifestyle.xml.builder +6 -0
- data/lib/xml/name.xml.builder +10 -0
- data/lib/xml/patientinfo.xml.builder +51 -0
- data/lib/xml/personalizedinfo.xml.builder +25 -0
- data/lib/xml/phone.xml.builder +10 -0
- data/lib/xml/progresscourse.xml.builder +89 -0
- data/lib/xml/registereddiagnosis.xml.builder +27 -0
- data/lib/xml/staffinfo.xml.builder +6 -0
- data/lib/xml/summary.xml.builder +125 -0
- data/lib/xml/surgery.xml.builder +81 -0
- data/spec/mml/admission_spec.rb +45 -0
- data/spec/mml/allergy_item_spec.rb +35 -0
- data/spec/mml/anesthesia_procedure_spec.rb +15 -0
- data/spec/mml/anesthesiologist_spec.rb +22 -0
- data/spec/mml/base_clinic_module_spec.rb +58 -0
- data/spec/mml/birth_info_spec.rb +90 -0
- data/spec/mml/blood_type_spec.rb +40 -0
- data/spec/mml/clinical_record_spec.rb +37 -0
- data/spec/mml/creator_info_spec.rb +3 -3
- data/spec/mml/creator_license_spec.rb +7 -0
- data/spec/mml/death_flag_spec.rb +11 -0
- data/spec/mml/death_info_spec.rb +19 -0
- data/spec/mml/department_spec.rb +3 -3
- data/spec/mml/diagnostic_category_spec.rb +23 -0
- data/spec/mml/discharge_spec.rb +29 -0
- data/spec/mml/dx_item_spec.rb +19 -0
- data/spec/mml/family_history_item_spec.rb +36 -0
- data/spec/mml/first_clinic_module_spec.rb +105 -0
- data/spec/mml/infection_item_spec.rb +39 -0
- data/spec/mml/inpatient_item_spec.rb +49 -0
- data/spec/mml/insurance_class_spec.rb +24 -0
- data/spec/mml/insurance_client_spec.rb +36 -0
- data/spec/mml/insurance_spec.rb +182 -0
- data/spec/mml/lifestyle_module_spec.rb +50 -0
- data/spec/mml/nationality_spec.rb +19 -0
- data/spec/mml/objective_spec.rb +51 -0
- data/spec/mml/operation_element_item_spec.rb +31 -0
- data/spec/mml/organization_info_spec.rb +35 -0
- data/spec/mml/other_blood_type_spec.rb +31 -0
- data/spec/mml/outpatient_item_spec.rb +48 -0
- data/spec/mml/past_history_item_spec.rb +23 -0
- data/spec/mml/past_history_spec.rb +17 -0
- data/spec/mml/patient_info_spec.rb +126 -0
- data/spec/mml/phone_spec.rb +5 -1
- data/spec/mml/physical_exam_item_spec.rb +40 -0
- data/spec/mml/plan_spec.rb +45 -0
- data/spec/mml/problem_item_spec.rb +35 -0
- data/spec/mml/procedure_item_spec.rb +44 -0
- data/spec/mml/progress_course_module_spec.rb +79 -0
- data/spec/mml/public_insurance_item_spec.rb +64 -0
- data/spec/mml/race_spec.rb +19 -0
- data/spec/mml/registered_diagnosis_spec.rb +124 -0
- data/spec/mml/related_doc_spec.rb +15 -0
- data/spec/mml/service_history_spec.rb +53 -0
- data/spec/mml/staff_info_spec.rb +31 -0
- data/spec/mml/subject_spec.rb +16 -0
- data/spec/mml/subjective_item_spec.rb +23 -0
- data/spec/mml/summary_module_spec.rb +239 -0
- data/spec/mml/surgery_item_spec.rb +132 -0
- data/spec/mml/surgery_module_spec.rb +90 -0
- data/spec/mml/surgical_staff_spec.rb +34 -0
- data/spec/mml/test_result_spec.rb +24 -0
- data/spec/mml/vaccination_item_spec.rb +38 -0
- data/spec/mml/value_with_link_spec.rb +15 -0
- data/spec/spec_helper.rb +1 -1
- metadata +137 -5
- checksums.yaml +0 -7
@@ -0,0 +1,82 @@
|
|
1
|
+
attributes = {'mmlHi:countryType' => countryType } if countryType
|
2
|
+
xml.mmlHi :HealthInsuranceModule, attributes do
|
3
|
+
attributes = {'mmlHi:ClassCode' => '01'} if insuranceClass.classCode
|
4
|
+
attributes['mmlHi:tableId'] = insuranceClass.tableId if insuranceClass.tableId
|
5
|
+
xml.mmlHi :insuranceClass, insuranceClass.value, attributes if insuranceClass
|
6
|
+
xml.mmlHi :insuranceNumber, insuranceNumber
|
7
|
+
xml.mmlHi :clientId do
|
8
|
+
xml.mmlHi :group, group
|
9
|
+
xml.mmlHi :number, number
|
10
|
+
end
|
11
|
+
xml.mmlHi :familyClass, familyClass
|
12
|
+
xml.mmlHi :clientInfo do
|
13
|
+
xml.mmlHi :personName do
|
14
|
+
clientInfo.personName.each do |name|
|
15
|
+
xml << name.to_xml
|
16
|
+
end
|
17
|
+
end if clientInfo.personName
|
18
|
+
xml.mmlHi :addresses do
|
19
|
+
clientInfo.addresses.each do |address|
|
20
|
+
xml << address.to_xml
|
21
|
+
end
|
22
|
+
end if clientInfo.addresses
|
23
|
+
xml.mmlHi :phones do
|
24
|
+
clientInfo.phones.each do |phone|
|
25
|
+
xml << phone.to_xml
|
26
|
+
end
|
27
|
+
end if clientInfo.phones
|
28
|
+
end if clientInfo
|
29
|
+
xml.mmlHi :continuedDiseases do
|
30
|
+
continuedDiseases.each do |disease|
|
31
|
+
xml.mmlHi :disease, disease
|
32
|
+
end
|
33
|
+
end if continuedDiseases
|
34
|
+
xml.mmlHi :startDate, startDate
|
35
|
+
xml.mmlHi :expiredDate, expiredDate
|
36
|
+
xml.mmlHi :paymentInRatio, paymentInRatio if paymentInRatio
|
37
|
+
xml.mmlHi :paymentOutRatio, paymentOutRatio if paymentOutRatio
|
38
|
+
xml.mmlHi :insuredInfo do
|
39
|
+
xml.mmlHi :facility do
|
40
|
+
xml << insuredInfo.facility.to_xml if insuredInfo.facility
|
41
|
+
end if insuredInfo.facility
|
42
|
+
xml.mmlHi :addresses do
|
43
|
+
insuredInfo.addresses.each do |address|
|
44
|
+
xml << address.to_xml
|
45
|
+
end
|
46
|
+
end if insuredInfo.addresses
|
47
|
+
xml.mmlHi :phones do
|
48
|
+
insuredInfo.phones.each do |phone|
|
49
|
+
xml << phone.to_xml
|
50
|
+
end
|
51
|
+
end if insuredInfo.phones
|
52
|
+
end if insuredInfo
|
53
|
+
xml.mmlHi :workInfo do
|
54
|
+
xml.mmlHi :facility do
|
55
|
+
xml << workInfo.facility.to_xml
|
56
|
+
end if workInfo.facility
|
57
|
+
xml.mmlHi :addresses do
|
58
|
+
workInfo.addresses.each do |address|
|
59
|
+
xml << address.to_xml
|
60
|
+
end
|
61
|
+
end if workInfo.addresses
|
62
|
+
xml.mmlHi :phones do
|
63
|
+
workInfo.phones.each do |phone|
|
64
|
+
xml << phone.to_xml
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end if workInfo
|
68
|
+
xml.mmlHi :publicInsurance do
|
69
|
+
publicInsurance.each do |item|
|
70
|
+
attribute = Hash.new
|
71
|
+
attribute = {'mmlHi:priority' => item.priority} if item.priority
|
72
|
+
xml.mmlHi :publicInsuranceItem, attribute do
|
73
|
+
xml.mmlHi :providerName, item.providerName if item.providerName
|
74
|
+
xml.mmlHi :provider, item.provider
|
75
|
+
xml.mmlHi :recipient, item.recipient
|
76
|
+
xml.mmlHi :startDate, item.startDate
|
77
|
+
xml.mmlHi :expiredDate, item.expiredDate
|
78
|
+
xml.mmlHi :paymentRatio, item.paymentRatio, {'mmlHi:ratioType' => item.ratioType} if item.paymentRatio
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end if publicInsurance
|
82
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
attributes = {'mmlNm:repCode' => repCode}
|
2
|
+
attributes[:tableId] = tableId if tableId
|
3
|
+
xml.mmlNm(:Name, attributes) do
|
4
|
+
xml.mmlNm :family, @family if @family
|
5
|
+
xml.mmlNm :middle, @middle if @middle
|
6
|
+
xml.mmlNm :given, @given if @given
|
7
|
+
xml.mmlNm :fullname, @fullname if @fullname
|
8
|
+
xml.mmlNm :prefix, @prefix if @prefix
|
9
|
+
xml.mmlNm :degree, @degree if @degree
|
10
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
xml.mmlPi :PatientModule do
|
2
|
+
xml.mmlPi :uniqueInfo do
|
3
|
+
xml.mmlPi :masterId do
|
4
|
+
xml << masterId.to_xml
|
5
|
+
end
|
6
|
+
otherId.each do |item|
|
7
|
+
xml.mmlPi :otherId, {'mmlPi:type' => item.type} do
|
8
|
+
xml << item.id.to_xml
|
9
|
+
end
|
10
|
+
end if otherId
|
11
|
+
end
|
12
|
+
personName.each do |name|
|
13
|
+
xml.mmlPi :personName do
|
14
|
+
xml << name.to_xml
|
15
|
+
end
|
16
|
+
end
|
17
|
+
xml.mmlPi :birthday, birthday
|
18
|
+
xml.mmlPi :sex, sex
|
19
|
+
if nationality
|
20
|
+
attributes = Hash.new
|
21
|
+
attributes = {'mmlPi:subtype' => nationality.subtype} if nationality.subtype
|
22
|
+
xml.mmlPi :nationality, nationality.value, attributes
|
23
|
+
end
|
24
|
+
if race
|
25
|
+
attributes = Hash.new
|
26
|
+
attributes = {'mmlPi:raceCode' => race.raceCode} if race.raceCode
|
27
|
+
attributes['mmlPi:raceCodeId'] = race.raceCodeId if race.raceCodeId
|
28
|
+
xml.mmlPi :race, race.value, attributes
|
29
|
+
end
|
30
|
+
xml.mmlPi :marital, marital
|
31
|
+
xml.mmlPi :addresses do
|
32
|
+
addresses.each do |address|
|
33
|
+
xml << address.to_xml
|
34
|
+
end
|
35
|
+
end if addresses
|
36
|
+
xml.mmlPi :emailAddresses do
|
37
|
+
emailAddresses.each do |email|
|
38
|
+
xml.mmlCm :email, email
|
39
|
+
end if emailAddresses
|
40
|
+
end if emailAddresses
|
41
|
+
xml.mmlPi :phones do
|
42
|
+
phones.each do |phone|
|
43
|
+
xml << phone.to_xml
|
44
|
+
end
|
45
|
+
end if phones
|
46
|
+
xml.mmlPi :accountNumber, accountNumber if accountNumber
|
47
|
+
xml.mmlPi :socialIdentification, socialIdentification if socialIdentification
|
48
|
+
death_attr = Hash.new
|
49
|
+
death_attr = {'mmlPi:date' => death.date} if death.date
|
50
|
+
xml.mmlPi :death, death.flag.to_s, death_attr unless death.nil?
|
51
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
xml.mmlPsi :PersonalizedInfo do
|
2
|
+
xml << id.to_xml
|
3
|
+
xml.mmlPsi :personName do
|
4
|
+
personName.each do |n|
|
5
|
+
xml << n.to_xml
|
6
|
+
end
|
7
|
+
end
|
8
|
+
xml << facility.to_xml if facility
|
9
|
+
xml << department.to_xml if department
|
10
|
+
xml.mmlPsi :addresses do
|
11
|
+
addresses.each do |address|
|
12
|
+
xml << address.to_xml
|
13
|
+
end
|
14
|
+
end if addresses
|
15
|
+
xml.mmlPsi :emailAddresses do
|
16
|
+
emailAddresses.each do |email|
|
17
|
+
xml.mmlCm :email, email
|
18
|
+
end
|
19
|
+
end if emailAddresses
|
20
|
+
xml.mmlPsi :phones do
|
21
|
+
phones.each do |phone|
|
22
|
+
xml << phone.to_xml
|
23
|
+
end
|
24
|
+
end if phones
|
25
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
attributes = {'mmlPh:telEquipType' => telEquipType} if telEquipType
|
2
|
+
xml.mmlPh :Phone, attributes do
|
3
|
+
xml.mmlPh :area, area if area
|
4
|
+
xml.mmlPh :city, city if city
|
5
|
+
xml.mmlPh :number, number if number
|
6
|
+
xml.mmlPh :extension, extension if extension
|
7
|
+
xml.mmlPh :full, full if full
|
8
|
+
xml.mmlPh :country, country if country
|
9
|
+
xml.mmlPh :memo, memo if memo
|
10
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
xml.mmlPc :ProgressCourseModule do
|
2
|
+
xml.mmlPc :FreeExpression do
|
3
|
+
xml << freeExpression
|
4
|
+
extRef.each do |ref|
|
5
|
+
xml << ref.to_xml
|
6
|
+
end if extRef
|
7
|
+
end if freeExpression
|
8
|
+
xml.mmlPc :structuredExpression do
|
9
|
+
structuredExpression.each do |item|
|
10
|
+
xml.mmlPc :problemItem do
|
11
|
+
attributes = Hash.new
|
12
|
+
attributes = {'mmlPc:dxUid' => item.dxUid} if item.dxUid
|
13
|
+
xml.mmlPc :problem, item.problem, attributes
|
14
|
+
xml.mmlPc :subjective do
|
15
|
+
xml.mmlPc :freeNotes, item.subjective.freeNotes if item.subjective.freeNotes
|
16
|
+
xml.mmlPc :subjectiveItem do
|
17
|
+
item.subjective.subjectiveItem.each do |sitem|
|
18
|
+
xml.mmlPc :timeExpression, sitem.timeExpression
|
19
|
+
sitem.eventExpression.each do |event|
|
20
|
+
xml.mmlPc :eventExpression, event
|
21
|
+
end if sitem.eventExpression
|
22
|
+
end
|
23
|
+
end if item.subjective.subjectiveItem
|
24
|
+
end if item.subjective
|
25
|
+
xml.mmlPc :objective do
|
26
|
+
xml.mmlPc :objectiveNotes, item.objective.objectiveNotes if item.objective.objectiveNotes
|
27
|
+
xml.mmlPc :physicalExam do
|
28
|
+
item.objective.physicalExam.each do |pitem|
|
29
|
+
xml.mmlPc :physicalExamItem do
|
30
|
+
xml.mmlPc :title, pitem.title
|
31
|
+
xml.mmlPc :result, pitem.result
|
32
|
+
xml.mmlPc :interpretation, pitem.interpretation if pitem.interpretation
|
33
|
+
xml.mmlPc :referenceInfo do
|
34
|
+
pitem.referenceInfo.each do |ref|
|
35
|
+
xml << ref.to_xml
|
36
|
+
end
|
37
|
+
end if pitem.referenceInfo
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end if item.objective.physicalExam
|
41
|
+
xml.mmlPc :testResult do
|
42
|
+
xml << item.objective.testResult.value
|
43
|
+
item.objective.testResult.link.each do |ref|
|
44
|
+
xml << ref.to_xml
|
45
|
+
end if item.objective.testResult.link
|
46
|
+
end if item.objective.testResult
|
47
|
+
xml.mmlPc :rxRecord do
|
48
|
+
xml << item.objective.rxRecord.value
|
49
|
+
item.objective.rxRecord.link.each do |ref|
|
50
|
+
xml << ref.to_xml
|
51
|
+
end if item.objective.rxRecord.link
|
52
|
+
end if item.objective.rxRecord
|
53
|
+
xml.mmlPc :txRecord do
|
54
|
+
xml << item.objective.txRecord.value
|
55
|
+
item.objective.txRecord.link.each do |ref|
|
56
|
+
xml << ref.to_xml
|
57
|
+
end
|
58
|
+
end if item.objective.txRecord
|
59
|
+
end if item.objective
|
60
|
+
xml.mmlPc :assessment do
|
61
|
+
item.assessment.each do |aitem|
|
62
|
+
xml.mmlPc :assessmentItem, aitem
|
63
|
+
end
|
64
|
+
end if item.assessment
|
65
|
+
xml.mmlPc :plan do
|
66
|
+
xml.mmlPc :testOrder do
|
67
|
+
xml << item.plan.testOrder.value
|
68
|
+
item.plan.testOrder.link.each do |ref|
|
69
|
+
xml << ref.to_xml
|
70
|
+
end if item.plan.testOrder.link
|
71
|
+
end if item.plan.testOrder
|
72
|
+
xml.mmlPc :rxOrder do
|
73
|
+
xml << item.plan.rxOrder.value
|
74
|
+
item.plan.rxOrder.link.each do |ref|
|
75
|
+
xml << ref.to_xml
|
76
|
+
end if item.plan.rxOrder.link
|
77
|
+
end if item.plan.rxOrder
|
78
|
+
xml.mmlPc :txOrder do
|
79
|
+
xml << item.plan.txOrder.value
|
80
|
+
item.plan.txOrder.link.each do |ref|
|
81
|
+
xml << ref.to_xml
|
82
|
+
end if item.plan.txOrder.link
|
83
|
+
end if item.plan.txOrder
|
84
|
+
xml.mmlPc :planNotes, item.plan.planNotes
|
85
|
+
end if item.plan
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end if structuredExpression
|
89
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
xml.mmlRd :RegisteredDiagnosisModule do
|
2
|
+
attributes = Hash.new
|
3
|
+
attributes = {'mmlRd:code' => code} if code
|
4
|
+
attributes['mmlRd:system'] = system if system
|
5
|
+
xml.mmlRd :diagnosis, attributes, diagnosis
|
6
|
+
xml.mmlRd :diagnosisContens do
|
7
|
+
diagnosisContents.each do |item|
|
8
|
+
attributes = Hash.new
|
9
|
+
attributes = {'mmlRd:code' => item.code} if item.code
|
10
|
+
attributes['mmlRd:system'] = item.system if item.system
|
11
|
+
xml.mmlRd :dxItem, attributes do
|
12
|
+
xml.mmlRd :name, item.name
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end if diagnosisContents
|
16
|
+
xml.mmlRd :categories do
|
17
|
+
categories.each do |category|
|
18
|
+
xml.mmlRd :category, {'mmlRd:tableId' => category.tableId}, category.value
|
19
|
+
end
|
20
|
+
end if categories
|
21
|
+
xml.mmlRd :startDate, startDate if startDate
|
22
|
+
xml.mmlRd :endDate, endDate if endDate
|
23
|
+
xml.mmlRd :outcome, outcome if outcome
|
24
|
+
xml.mmlRd :firstEncounterDate, firstEncounterDate if firstEncounterDate
|
25
|
+
attributes =
|
26
|
+
xml.mmlRd :relatedHealthInsurance, {'mmlRd:uid' => relatedHealthInsurance} if relatedHealthInsurance
|
27
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
xml.mmlSm :SummaryModule do
|
2
|
+
attributes = Hash.new
|
3
|
+
attributes['mmlSm:start'] = serviceHistory.start if serviceHistory.start
|
4
|
+
attributes['mmlSm:end'] = serviceHistory.end if serviceHistory.end
|
5
|
+
xml.mmlSm :serviceHistory, attributes do
|
6
|
+
xml.mmlSm :outPatient do
|
7
|
+
serviceHistory.outPatient.each do |item|
|
8
|
+
xml.mmlSm :outPatientItem do
|
9
|
+
xml.mmlSm :date, item.date
|
10
|
+
condition_attr = Hash.new
|
11
|
+
condition_attr['mmlSm:first'] = item.first unless item.first.nil?
|
12
|
+
condition_attr['mmlSm:emergency'] = item.emergency unless item.emergency.nil?
|
13
|
+
xml.mmlSm :outPatientCondition, item.outPatientCondition, condition_attr if item.outPatientCondition
|
14
|
+
xml.mmlSm :staffs do
|
15
|
+
item.staffs.each do |staff|
|
16
|
+
xml << staff.to_xml
|
17
|
+
end
|
18
|
+
end if item.staffs
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end if serviceHistory.outPatient
|
22
|
+
xml.mmlSm :inPatient do
|
23
|
+
serviceHistory.inPatient.each do |item|
|
24
|
+
xml.mmlSm :inPatientItem do
|
25
|
+
xml.mmlSm :admission do
|
26
|
+
xml.mmlSm :date, item.admission.date
|
27
|
+
if item.admission.admissionCondition
|
28
|
+
admission_attr = Hash.new
|
29
|
+
admission_attr['mmlSm:emergency'] = item.admission.emergency unless item.admission.emergency.nil?
|
30
|
+
xml.mmlSm :admissionCondition, item.admission.admissionCondition, admission_attr
|
31
|
+
end
|
32
|
+
xml.mmlSm :referFrom do
|
33
|
+
xml << item.admission.referFrom.to_xml
|
34
|
+
end if item.admission.referFrom
|
35
|
+
end
|
36
|
+
xml.mmlSm :discharge do
|
37
|
+
xml.mmlSm :date, item.discharge.date
|
38
|
+
if item.discharge.dischargeCondition
|
39
|
+
discharge_attr = Hash.new
|
40
|
+
discharge_attr['mmlSm:outcome'] = item.discharge.outcome if item.discharge.outcome
|
41
|
+
xml.mmlSm :dischargeCondition, item.discharge.dischargeCondition, discharge_attr
|
42
|
+
end
|
43
|
+
xml.mmlSm :referTo do
|
44
|
+
xml << item.discharge.referTo.to_xml
|
45
|
+
end if item.discharge.referTo
|
46
|
+
end
|
47
|
+
xml.mmlSm :staffs do
|
48
|
+
item.staffs.each do |staff|
|
49
|
+
xml << staff.to_xml
|
50
|
+
end
|
51
|
+
end if item.staffs
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end if serviceHistory.inPatient
|
55
|
+
end
|
56
|
+
registeredDiagnosis.each do |diagnosis|
|
57
|
+
xml << diagnosis.to_xml
|
58
|
+
end if registeredDiagnosis
|
59
|
+
if deathInfo
|
60
|
+
death_attr = Hash.new
|
61
|
+
death_attr['mmlSm:date'] = deathInfo.date if deathInfo.date
|
62
|
+
death_attr['mmlSm:autopsy'] = deathInfo.autopsy unless deathInfo.autopsy.nil?
|
63
|
+
xml.mmlSm :deathInfo, deathInfo.value, death_attr
|
64
|
+
end
|
65
|
+
surgeryModule.each do |surgery|
|
66
|
+
xml << surgery.to_xml
|
67
|
+
end if surgeryModule
|
68
|
+
xml.mmlSm :chiefComplaints, chiefComplaints if chiefComplaints
|
69
|
+
xml.mmlSm :patientProfile, patientProfile if patientProfile
|
70
|
+
xml.mmlSm :history, history if history
|
71
|
+
xml.mmlSm :physicalExam do
|
72
|
+
xml << physicalExam.value
|
73
|
+
physicalExam.link.each do |link|
|
74
|
+
xml << link.to_xml
|
75
|
+
end if physicalExam.link
|
76
|
+
end if physicalExam
|
77
|
+
xml.mmlSm :clinicalCourse do
|
78
|
+
clinicalCourse.each do |record|
|
79
|
+
record_attr = Hash.new
|
80
|
+
record_attr['mmlSm:date'] = record.date
|
81
|
+
xml.mmlSm :clinicalRecord, record_attr do
|
82
|
+
xml << record.value
|
83
|
+
record.extRef.each do |ref|
|
84
|
+
xml << ref.to_xml
|
85
|
+
end if record.extRef
|
86
|
+
record.relatedDoc.each do |doc|
|
87
|
+
doc_attr = Hash.new
|
88
|
+
doc_attr['mmlSm:relation'] = doc.relation if doc.relation
|
89
|
+
xml.mmlSm :relatedDoc, doc.value, doc_attr
|
90
|
+
end if record.relatedDoc
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end if clinicalCourse
|
94
|
+
xml.mmlSm :dischargeFindings do
|
95
|
+
xml << dischargeFindings.value
|
96
|
+
dischargeFindings.link.each do |link|
|
97
|
+
xml << link.to_xml
|
98
|
+
end if dischargeFindings.link
|
99
|
+
end if dischargeFindings
|
100
|
+
xml.mmlSm :medication do
|
101
|
+
xml << medication.value
|
102
|
+
medication.link.each do |link|
|
103
|
+
xml << link.to_xml
|
104
|
+
end if medication.link
|
105
|
+
end if medication
|
106
|
+
xml.mmlSm :testResults do
|
107
|
+
testResults.each do |test|
|
108
|
+
test_attr = Hash.new
|
109
|
+
test_attr['mmlSm:date'] = test.date if test.date
|
110
|
+
xml.mmlSm :testResult, test_attr do
|
111
|
+
xml << test.value
|
112
|
+
test.link.each do |link|
|
113
|
+
xml << link.to_xml
|
114
|
+
end if test.link
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end if testResults
|
118
|
+
xml.mmlSm :plan do
|
119
|
+
xml << plan.value
|
120
|
+
plan.link.each do |link|
|
121
|
+
xml << link.to_xml
|
122
|
+
end if plan.link
|
123
|
+
end if plan
|
124
|
+
xml.mmlSm :remarks, remarks if remarks
|
125
|
+
end
|