Written by

Senior Cloud Architect at InterSystems
MOD
Question Eduard Lebedyuk · Jun 15, 2023

How to import VSCode HL7 Custom Schema

How to import Custom Schemas from VSCode? They look like this:

<?xml version="1.0"?>
<Category name="ITK" description="xmlns:hl7='urn:hl7-org:v2xml' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" std="1">
<MessageType name='ACK' structure='ACK' returntype='ACK' description='xsi:schemaLocation="urn:hl7-org:v2xml ACK.xsd"'/>
</Category>

Instead of wrapped XML export produced by $system.OBJ:

<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2022.1 (Build 209U)" ts="2023-06-15 20:19:56">
<Document name="ITK.HL7">
<Category name="ITK" description="xmlns:hl7='urn:hl7-org:v2xml' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" std="1">
<MessageType name='ACK' structure='ACK' returntype='ACK' description='xsi:schemaLocation="urn:hl7-org:v2xml ACK.xsd"'/>
</Category>
</Document>
</Export>

Preferably I need a LoadDir method.

Product version: IRIS 2023.1

Comments

Eduard Lebedyuk · Jun 15, 2023

Anything better than manual wrangling:

Set tSC=##class(%Atelier.v2.Utils.TextServices).SetTextFromArray(.tTextArray,0,"CatNameFromFile","OTH",0)
0
Eduard Lebedyuk · Jun 16, 2023

Found it:

set sc = ##class(EnsLib.HL7.SchemaXML).Import(filenameOrStream)

Works with both old and new export.

0