From d5a2b79a1d8b23aad5d730fcc128cefb931e5268 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Mon, 1 Oct 2012 10:35:30 -0400 Subject: [PATCH 1/3] Adding incision date time to procedure --- app/assets/javascripts/procedure.js.coffee | 7 ++++++- test/fixtures/patient/barry_berry.json | 3 ++- test/unit/patient_api_test.rb | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/procedure.js.coffee b/app/assets/javascripts/procedure.js.coffee index 7ae072c..489e12a 100644 --- a/app/assets/javascripts/procedure.js.coffee +++ b/app/assets/javascripts/procedure.js.coffee @@ -25,4 +25,9 @@ class hQuery.Procedure extends hQuery.CodedEntry @returns {hQuery.CodedValue} A SNOMED code indicating the body site on which the procedure was performed ### - site: -> new hQuery.CodedValue @json['site']['code'], @json['site']['codeSystem'] \ No newline at end of file + site: -> new hQuery.CodedValue @json['site']['code'], @json['site']['codeSystem'] + + ###* + @returns {Date} Date/Time when the incision was made during a procedure, if applicable + ### + incisionDateTime: -> hQuery.dateFromUtcSeconds @json['incisionDateTime'] \ No newline at end of file diff --git a/test/fixtures/patient/barry_berry.json b/test/fixtures/patient/barry_berry.json index 8f97f14..3975596 100644 --- a/test/fixtures/patient/barry_berry.json +++ b/test/fixtures/patient/barry_berry.json @@ -217,7 +217,8 @@ "last": "Tables" } }, - "description": "Colonscopy" + "description": "Colonscopy", + "incisionDateTime": 1073238725 } ], "results": [ diff --git a/test/unit/patient_api_test.rb b/test/unit/patient_api_test.rb index 6ae2d67..a457a96 100644 --- a/test/unit/patient_api_test.rb +++ b/test/unit/patient_api_test.rb @@ -66,6 +66,7 @@ def test_procedures assert_equal '71854001', @context.eval('patient.procedures()[0].site().code()') assert_equal 'Bobby', @context.eval('patient.procedures()[0].performer().person().given()') assert_equal 'Tables', @context.eval('patient.procedures()[0].performer().person().last()') + assert_equal 1073238725000, @context.eval('patient.procedures()[0].incisionDateTime().getTime()') end def test_vital_signs From 507d9c6ab92f78b0961b05866db55ffe61908e81 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Mon, 1 Oct 2012 10:46:13 -0400 Subject: [PATCH 2/3] Adding length of stay to a facility --- app/assets/javascripts/core.js.coffee | 5 +++++ test/fixtures/patient/barry_berry.json | 2 ++ test/unit/patient_api_test.rb | 1 + 3 files changed, 8 insertions(+) diff --git a/app/assets/javascripts/core.js.coffee b/app/assets/javascripts/core.js.coffee index 4476c79..d4ca91e 100644 --- a/app/assets/javascripts/core.js.coffee +++ b/app/assets/javascripts/core.js.coffee @@ -272,6 +272,11 @@ class hQuery.Facility extends hQuery.CodedValue ### endDate: -> @_endDate + ###* + The length of stay in this facility in seconds + @returns {Integer} + ### + lengthOfStay: -> @json['end_time'] - @json['start_time'] ###* @returns {Array} an array of {@link hQuery.Address} objects associated with the facility diff --git a/test/fixtures/patient/barry_berry.json b/test/fixtures/patient/barry_berry.json index 3975596..43da9d2 100644 --- a/test/fixtures/patient/barry_berry.json +++ b/test/fixtures/patient/barry_berry.json @@ -77,6 +77,8 @@ }, "facility": { "name": "General Hospital", + "start_time": 1124956803, + "end_time": 1124957003, "code": { "code": "1155-1", "codeSystem": "HL7 Healthcare Service Location" diff --git a/test/unit/patient_api_test.rb b/test/unit/patient_api_test.rb index a457a96..f9f67a0 100644 --- a/test/unit/patient_api_test.rb +++ b/test/unit/patient_api_test.rb @@ -51,6 +51,7 @@ def test_encounters assert_equal 'CPT', @context.eval('patient.encounters()[0].reasonForVisit().type()[0].codeSystemName()') assert_equal 'HL7 Healthcare Service Location', @context.eval('patient.encounters()[0].facility().codeSystemName()') assert_equal '1155-1', @context.eval('patient.encounters()[0].facility().code()') + assert_equal 200, @context.eval('patient.encounters()[0].facility().lengthOfStay()') assert_equal 'General Hospital', @context.eval('patient.encounters()[0].facility().name()') end From 5688237c1083363916b6a7c35266c1c35921fffa Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Mon, 1 Oct 2012 10:54:20 -0400 Subject: [PATCH 3/3] Adding removalDateTime to medical equipment --- app/assets/javascripts/medicalequipment.js.coffee | 6 ++++++ test/unit/patient_api_test.rb | 1 + 2 files changed, 7 insertions(+) diff --git a/app/assets/javascripts/medicalequipment.js.coffee b/app/assets/javascripts/medicalequipment.js.coffee index 9976ad3..57eee07 100644 --- a/app/assets/javascripts/medicalequipment.js.coffee +++ b/app/assets/javascripts/medicalequipment.js.coffee @@ -26,3 +26,9 @@ class hQuery.MedicalEquipment extends hQuery.CodedEntry @returns {CodedValue} ### anatomicalStructure: -> new hQuery.CodedValue @json['anatomicalStructure']['code'], @json['anatomicalStructure']['codeSystem'] + + ###* + Currently mapped to the end date for the medical equipment + @returns {Date} + ### + removalDateTime: -> @endDate() \ No newline at end of file diff --git a/test/unit/patient_api_test.rb b/test/unit/patient_api_test.rb index f9f67a0..e4df4af 100644 --- a/test/unit/patient_api_test.rb +++ b/test/unit/patient_api_test.rb @@ -175,6 +175,7 @@ def test_functional_status def test_medical_equipment assert_equal 1, @context.eval('patient.medicalEquipment().length') assert_equal '13648007', @context.eval('patient.medicalEquipment()[0].anatomicalStructure().code()') + assert_equal 1269762693000, @context.eval('patient.medicalEquipment()[0].removalDateTime().getTime()') end end \ No newline at end of file