3 var fieldLevel = require('../fieldLevel');
4 var leafLevel = require('../leafLevel');
5 var condition = require('../condition');
6 var contentModifier = require("../contentModifier");
8 var sel = require("./sharedEntryLevel");
10 var key = contentModifier.key;
11 var required = contentModifier.required;
12 var dataKey = contentModifier.dataKey;
14 var allergyStatusObservation = {
21 fieldLevel.templateId("2.16.840.1.113883.10.20.22.4.28"),
22 fieldLevel.templateCode("AllergyStatusObservation"),
23 fieldLevel.statusCodeCompleted, {
29 existsWhen: condition.codeOrDisplayname,
36 var allergyIntoleranceObservation = exports.allergyIntoleranceObservation = {
41 "negationInd": leafLevel.boolInputProperty("negation_indicator")
44 fieldLevel.templateIdExt("2.16.840.1.113883.10.20.22.4.7", "2014-06-09"),
45 fieldLevel.templateId("2.16.840.1.113883.10.20.22.4.7"),
47 fieldLevel.templateCode("AllergyObservation"),
48 fieldLevel.statusCodeCompleted, [fieldLevel.effectiveTime, required], {
59 "value": leafLevel.nextReference("reaction")
63 dataKey: 'intolerance',
64 existsWhen: condition.codeOrDisplayname,
72 key: "participantRole",
83 attributes: leafLevel.code,
89 "value": leafLevel.sameReference("reaction")
94 attributes: leafLevel.code,
95 dataKey: "translations"
104 key: "entryRelationship",
107 "inversionInd": "true"
110 [allergyStatusObservation, required]
112 existsWhen: condition.keyExists("status")
114 key: "entryRelationship",
117 "inversionInd": "true"
120 [sel.reactionObservation, required]
122 dataKey: 'reactions',
123 existsWhen: condition.keyExists('reaction')
125 key: "entryRelationship",
128 "inversionInd": "true"
131 [sel.severityObservation, required]
133 existsWhen: condition.keyExists('severity')
136 dataKey: "observation",
138 "negationInd attribute is not specified in specification"
142 var allergyProblemAct = exports.allergyProblemAct = {
149 fieldLevel.templateIdExt("2.16.840.1.113883.10.20.22.4.30", "2015-08-01"),
150 fieldLevel.templateId("2.16.840.1.113883.10.20.22.4.30"),
153 fieldLevel.templateCode("AllergyProblemAct"),
154 fieldLevel.statusCodeActive, [fieldLevel.effectiveTime, required], {
155 key: "entryRelationship",
160 content: [allergyIntoleranceObservation, required],
161 existsWhen: condition.keyExists('observation'),
163 warning: "inversionInd is not in spec"
166 warning: "statusCode is not constant in spec"