Hey @william_vw
Creator of medblocks-ui here. I have some experience with generating user interfaces from templates. I agree with @pablo that directly working with archetypes is hard. In fact, I skipped the OPT step and started working directly with web templates. EHRbase supports converting OPTs to web templates, and you can probably find the code to do that yourself.
Now coming to the problem of terminology and language bindings in the template, it all comes down to the information you have in the template. Most of the time this is set during template creation and not at the archetype level.
For example, Chief complaint inside a Problem/Diagnosis archetype: I usually set the default code to a SNOMED CT expression like so:
This gets translated to the following in the web template:
{
"id" : "chief_complaint",
"name" : "Chief Complaint",
"localizedName" : "Chief Complaint",
"rmType" : "DV_CODED_TEXT",
"nodeId" : "at0002",
"min" : 1,
"max" : 1,
"localizedNames" : {
"en" : "Chief Complaint"
},
"localizedDescriptions" : {
"en" : "Identification of the problem or diagnosis, by name."
},
"annotations" : {
"comment" : "Coding of the name of the problem or diagnosis with a terminology is preferred, where possible."
},
"aqlPath" : "/content[openEHR-EHR-EVALUATION.problem_diagnosis.v1]/data[at0001]/items[at0002,'Chief Complaint']/value",
"inputs" : [ {
"suffix" : "code",
"type" : "TEXT",
"defaultValue" : "<404684003",
"terminology" : "SNOMED-CT"
}, {
"suffix" : "value",
"type" : "TEXT",
"terminology" : "SNOMED-CT"
} ]
}
Now you just have to map this out to a user interface element. Probably using some code like this.
And that maps to:
<mb-search path="template/problem_diagnosis/chief_complaint" label="Chief Complaint">
<mb-filter label="Conditions" value="<404684003"></mb-filter>
</mb-search>
However, note that sometimes, at the application level you might want to have more control of this binding.
For example, Add Events also to the Chief Complaint section:
<mb-search path="template/problem_diagnosis/chief_complaint" label="Chief Complaint">
<mb-filter label="Conditions" value="<404684003"></mb-filter>
<mb-filter label="Events" value="<272379006"></mb-filter>
</mb-search>
The output looks like:
The clinician can then choose to opt out of these filters if necessary.
Regarding language, you’ll find that in the localizedName
and localizedDescription
section of the web template.