nightingaleproject / VRDR_javalib

Java library implementation of the VRDR fhir standard http://hl7.org/fhir/us/vrdr/
Apache License 2.0
2 stars 1 forks source link

fix block_count accordingly for ack and void messages #65

Open consultantusa opened 1 year ago

consultantusa commented 1 year ago

public BaseMessage buildVoidMessageObject(String identifier, Integer blockCount) throws Exception { // Create a VRDR void message DeathRecordVoidMessage message = new DeathRecordVoidMessage(); message.setMessageSource(MessageUtil.STATE_MESSAGE_ENDPOINT_URI); message.setBlockCount(blockCount== null ? Integer.valueOf(1) : blockCount); message.setJurisdictionId("UT"); message.setCertNo(Integer.parseInt(identifier.substring(6))); message.setDeathYear(Integer.parseInt(identifier.substring(0, 4))); message.setStateAuxiliaryId(identifier);

return message;

}

================== submission message:

{ "name": "block_count", "valuePositiveInt": 16 }

The acknowledge message does not include "block_count" for the above, but does for the below.

{ "name": "block_count", "valueUnsignedInt": 16 }

============ Void Message:

{ "resourceType": "Bundle", "id": "10d27d60-0f8d-4932-a902-3c3ca955bb59", "type": "message", "timestamp": "2023-07-20T10:48:28.767-06:00", "entry": [ { "fullUrl": "urn:uuid:4804deaa-a759-4bd8-a9a3-4d8e1f6a8673", "resource": { "resourceType": "MessageHeader", "id": "4804deaa-a759-4bd8-a9a3-4d8e1f6a8673", "meta": { "profile": [ "http://cdc.gov/nchs/nvss/fhir/vital-records-messaging/StructureDefinition/VRM-SubmissionHeader" ] }, "eventUri": "http://nchs.cdc.gov/vrdr_submission_void", "destination": [ { "endpoint": "http://nchs.cdc.gov/vrdr_submission" } ], "source": { "endpoint": "https://utah.gov/VRDR/fhir/message/endpoint" }, "focus": [ { "reference": "urn:uuid:b0a45935-faf1-4788-a390-102ed95837d5" } ] } }, { "fullUrl": "urn:uuid:b0a45935-faf1-4788-a390-102ed95837d5", "resource": { "resourceType": "Parameters", "id": "b0a45935-faf1-4788-a390-102ed95837d5", "meta": { "profile": [ "http://cdc.gov/nchs/nvss/fhir/vital-records-messaging/StructureDefinition/VRM-MessageParameters" ] }, "parameter": [ { "name": "block_count", "valueUnsignedInt": 16 }, { "name": "jurisdiction_id", "valueString": "UT" }, { "name": "cert_no", "valueUnsignedInt": 86 }, { "name": "death_year", "valueUnsignedInt": 2023 }, { "name": "state_auxiliary_id", "valueString": "2023000086" } ] } } ] } Acknowledgement Message: { "resourceType": "Bundle", "id": "6f225981-9b6b-4d59-ae3d-1f02bb392ff3", "type": "message", "timestamp": "2023-07-20T10:49:26.317-06:00", "entry": [ { "fullUrl": "urn:uuid:35a04208-c421-46e3-b34b-63ff56594e40", "resource": { "resourceType": "MessageHeader", "id": "35a04208-c421-46e3-b34b-63ff56594e40", "eventUri": "http://nchs.cdc.gov/vrdr_acknowledgement", "destination": [ { "endpoint": "https://utah.gov/VRDR/fhir/message/endpoint" } ], "source": { "endpoint": "http://nchs.cdc.gov/vrdr_submission" }, "response": { "identifier": "4804deaa-a759-4bd8-a9a3-4d8e1f6a8673", "code": "ok" } } }, { "fullUrl": "urn:uuid:77a09688-3be2-4475-999a-91b970f29a86", "resource": { "resourceType": "Parameters", "id": "77a09688-3be2-4475-999a-91b970f29a86", "parameter": [ { "name": "cert_no", "valueUnsignedInt": 86 }, { "name": "state_auxiliary_id", "valueString": "2023000086" }, { "name": "jurisdiction_id", "valueString": "UT" }, { "name": "death_year", "valueUnsignedInt": 2023 }, { "name": "block_count", "valuePositiveInt": 16 } ] } } ] }