Are there any restrictions on the Segments that should be used for a Specific message type? For Ex: If I have to create a sample HL7 ADT^A05 or REF message.. Can I include any segment that I like, or HL7 has some rules defined to choose the segments for specific message type?
Is the below Hl7 Message correct?
MSH|^~&|DASH|DASH-GCD|CentralLogic|COCXXX|20130730183557||REF^I12|20130730183339|P|2.3.1|||AL|AL
PID|0||26||Test^Patient^^^||19950115|M|||||Phone#^Email||||||SSN#|PD1|||||PCP FName^LName|RF1|Pending|Patient ETA|Direct Admit|Doc-to-Doc|Critical|Admission#||||Note Info|PRD|RP|Smith^Ken^|1600 Medical Center Way^^Eureka^CA^95521||(707)555-5555||NPI#PRD|RT|Pacific Heart Group^Physician Name|Admitting Facility Name||(707)444-8300
NUP|Bed Location|Bed StatusIN1|1|||Insurance Company Name|Patient Gr ID|Patient Member ID||||||||IN2|Insured’s Employee ID|Insured’s Social Security Number|Insured’s Employer Name|OBX|1|CE|1010.1^BODY WEIGHT||154|LBOBX|2|CE|1010.1^HEIGHT||75|INDG1|1|I9|786.59|Chest pain||DG1|2|I9|794.31|Sun Burn||AL1|1|DRUG|Codeine|AL1|2|DRUG|PCN|RXO|CE|Albuterol 2.5 mg via Ben q6h prn sob||||||ODT|CE||Test Instruction
There are restrictions defined by HL7 on the segment to use. That being said, your messages will also be defined by the data exchange needs of the systems you are interfacing, and for that you should develop a specification.
The specification (conformance profile) would contain:
This article explains what goes into a spec: http://caristix.com/blog/2013/02/hl7-survival-guide-chapter-6-hl7-interface-specifications/. It gives several reference sources.