ruby-hl7-extensions 0.0.3 → 0.0.4
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/VERSION +1 -1
- data/VERSION.yml +1 -1
- data/lib/core_ext/message.rb +12 -1
- data/lib/core_ext/segments/pid.rb +10 -2
- data/lib/core_ext/segments/pv1.rb +8 -0
- data/ruby-hl7-extensions.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efaf834a166b854120c702029aa602d790d678c5
|
4
|
+
data.tar.gz: 9b19a36fe05d084582a06437d9e4391079fe7ab2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b00d846b27efe17b7c287a370b67937775842cc4d438fd2e33851084909b4aa31725291dccd7df6ecc606da3b943266d927d4b13de0f15c9ff95a2f4aa9477a7
|
7
|
+
data.tar.gz: 8a844fa42b3a0150da77f52781e4050626abf3489fbac46eea5005cc7b85f1baed16d4929b6e3f4dee77e9e622264ea28e18c327b85191d62a67063e4f855778
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/VERSION.yml
CHANGED
data/lib/core_ext/message.rb
CHANGED
@@ -31,7 +31,7 @@ module Extensions
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def event
|
34
|
-
hash[:message][:content]["
|
34
|
+
hash[:message][:content]["MSH"]["messageEvent"]
|
35
35
|
end
|
36
36
|
|
37
37
|
def sending_application
|
@@ -47,6 +47,12 @@ module Extensions
|
|
47
47
|
Date.parse(hash["message"]["content"]["PID"]["dateTimeBirth"]).strftime("%B %d, %Y")
|
48
48
|
end
|
49
49
|
|
50
|
+
def patient_mrn
|
51
|
+
pid = hash["message"]["content"]["PID"]
|
52
|
+
@pid ||= ::HL7::Message::Segment.from_hash("PID", pid)
|
53
|
+
@pid.mrn
|
54
|
+
end
|
55
|
+
|
50
56
|
def patient_gender
|
51
57
|
hash["message"]["content"]["PID"]["sex"]
|
52
58
|
end
|
@@ -56,6 +62,11 @@ module Extensions
|
|
56
62
|
a.to_enum(:each)
|
57
63
|
end
|
58
64
|
|
65
|
+
def patient_visit
|
66
|
+
patient_visit = hash["message"]["content"]["PV1"]
|
67
|
+
::HL7::Message::Segment.from_hash("PV1", patient_visit)
|
68
|
+
end
|
69
|
+
|
59
70
|
def hash
|
60
71
|
to_hash
|
61
72
|
end
|
@@ -9,14 +9,22 @@ module Extensions
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module InstanceMethods
|
12
|
+
def mrn
|
13
|
+
to_hash["internalId"]["id"]
|
14
|
+
end
|
15
|
+
|
12
16
|
def to_hash
|
17
|
+
return @hash if @hash
|
18
|
+
|
13
19
|
patient_name = self.patient_name.split("^") rescue Array.new(10) {|i| "" }
|
14
20
|
address = self.address.split("^") rescue Array.new(10) {|i| "" }
|
15
21
|
patientAccountNumber = self.account_number.split("^") rescue Array.new(10) {|i| "" }
|
16
|
-
|
22
|
+
internalId = self.patient_id_list.split("^") rescue Array.new(10) {|i| "" }
|
23
|
+
|
17
24
|
@hash = {"setId" => self.set_id,
|
18
25
|
"externalId" => self.patient_id,
|
19
|
-
"internalId" => {"id" =>
|
26
|
+
"internalId" => {"id" => internalId[0], "check_digit" => internalId[1], "check_digit_scheme" => internalId[2],
|
27
|
+
"assigning_authority" => internalId[3], "type" => internalId[4], "assigning_facility" => internalId[5]},
|
20
28
|
"alternateId" => self.alt_patient_id,
|
21
29
|
"patientName" => {"lastName" => patient_name[0], "firstName" => patient_name[1], "middleInitOrName"=> patient_name[2]},
|
22
30
|
"mothersMaidenName" => self.mother_maiden_name,
|
@@ -9,6 +9,14 @@ module Extensions
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module InstanceMethods
|
12
|
+
def [](key)
|
13
|
+
to_hash[key]
|
14
|
+
end
|
15
|
+
|
16
|
+
def account_number
|
17
|
+
to_hash["visit"]["id"]
|
18
|
+
end
|
19
|
+
|
12
20
|
def admitting_provider_hash
|
13
21
|
to_hash["admittingProvider"].merge("providerType" => "AD")
|
14
22
|
end
|
data/ruby-hl7-extensions.gemspec
CHANGED