Loksly/nodehl7

Unkown segmentType (): SPM

Closed this issue · 5 comments

Getting an error Unkown segmentType (): SPM when trying to parse an HL7

SPM was not yet supported.

Try to update to latest version (npm i nodehl7@0.2.4).

If you see a message like 'Unkown segmentType (): XXX' consider pulling a Merge Request with a new file like the one you can find on lib/segments/spm.json.

Review #8 for more info.

Have a nice day.

@Loksly can you point to some resource regarding what would be the contents of a {segment}.json file that'll go into lib/segments? I am using this lib at work, and we'll be interfacing with many labs, so might need to add segments from time to time.

For example, if we take the spm.json file that you added, I can see that the fields in the json match with the fields listed here. For adding a new segment, will just following the process of taking fields from hl7-definition and adding a json containing those fields in the correct order work?

Hi kapil,

the contents are a field named name with the name of the segment in uppercase, plus a field named fields with the name of the fields you spec to find in that segment. Example

The source for SPM segment was https://hl7-definition.caristix.com/v2/HL7v2.8/Segments/SPM although now I see that this source http://www.hl7.eu/refactored/segSPM.html has two more fields. I guess this last one should be used rather than the other one. Let me know if you want me to add these 2 fields.

Hi @Loksly ,

I see 3 more fields in the second link. "Culture Start Date/Time", "Culture Final Date/Time", "Action Code". I am sending a PR with these fields added to spm.json.

merged and published: use 0.2.5 version