|
| 1 | +<htmlform formUuid="9c180d22-7ef6-49e4-8e52-ff314e218451" |
| 2 | + formEncounterType="c31d3312-40c4-11e7-a919-92ebcb67fe33" |
| 3 | + formName="HIV Followup" formVersion="1.0"> |
| 4 | + |
| 5 | + <style type="text/css"> |
| 6 | + #who-when-where { |
| 7 | + margin-bottom: 6px; |
| 8 | + border-bottom: 1px solid #ccc; |
| 9 | + } |
| 10 | + |
| 11 | + #who-when-where p { |
| 12 | + display: inline-block; |
| 13 | + padding-right: 20px; |
| 14 | + } |
| 15 | + |
| 16 | + #where > input[type=text] { |
| 17 | + display: inline-block; |
| 18 | + } |
| 19 | + |
| 20 | + .narrow { |
| 21 | + width: 200px; |
| 22 | + } |
| 23 | + |
| 24 | + .field-error { |
| 25 | + color: #ff6666; |
| 26 | + font-size: 1.1em; |
| 27 | + display: block; |
| 28 | + } |
| 29 | + |
| 30 | + <ifMode mode="VIEW" include="false"> |
| 31 | + #data-collection { |
| 32 | + display: inline-block; |
| 33 | + width: 58%; |
| 34 | + vertical-align: top; |
| 35 | + } |
| 36 | + |
| 37 | + #encounter-diagnoses-target { |
| 38 | + display: inline-block; |
| 39 | + width: 40%; |
| 40 | + vertical-align: top; |
| 41 | + } |
| 42 | + |
| 43 | + #encounter-diagnoses-app { |
| 44 | + margin-bottom: 20px; |
| 45 | + } |
| 46 | + </ifMode> |
| 47 | + |
| 48 | + <ifMode mode="EDIT"> |
| 49 | + #disposition small { |
| 50 | + font-size: 100%; |
| 51 | + display: block; |
| 52 | + } |
| 53 | + |
| 54 | + #disposition span { |
| 55 | + padding-left: 15px; |
| 56 | + } |
| 57 | + </ifMode> |
| 58 | + </style> |
| 59 | + |
| 60 | + <!-- the two ifMode blocks below enable a bit of hack: when opening in ENTER mode, we just want to create the encounter, |
| 61 | + we don't actually want to display the form, so we hae it hidden by default, and then automatically trigger the submit; |
| 62 | + note that this will fail in the case where there isn't a default provider or date (which I don't think we have in our use cases --> |
| 63 | + |
| 64 | + <ifMode mode="ENTER" include="true"> |
| 65 | + <script type="text/javascript"> |
| 66 | + jq(function() { |
| 67 | + // if for some reason there's no encounter location selected (likely because the session location isn't |
| 68 | + // a valid location for this encounter) we need to show the form, otherwise just submit |
| 69 | + if (!getValue("encounterLocation.value")) { |
| 70 | + jq('#next').hide(); |
| 71 | + jq('.htmlform').show(); |
| 72 | + } |
| 73 | + else { |
| 74 | + submitHtmlForm(); |
| 75 | + } |
| 76 | + }); |
| 77 | + </script> |
| 78 | + </ifMode> |
| 79 | + |
| 80 | + <ifMode mode="EDIT" include="true"> |
| 81 | + <script type="text/javascript"> |
| 82 | + jq(function() { |
| 83 | + |
| 84 | + jq('.htmlform').show(); |
| 85 | + |
| 86 | + jq('#next').click(function() { |
| 87 | + window.htmlForm.getBeforeSubmit().push(function () { |
| 88 | + window.htmlForm.setReturnUrl(window.htmlForm.getReturnUrl() + "&goToNextSection=encounter-info"); |
| 89 | + return true; |
| 90 | + }); |
| 91 | + |
| 92 | + window.htmlForm.submitHtmlForm(); |
| 93 | + }) |
| 94 | + |
| 95 | + jq('#submit').click(function() { |
| 96 | + window.htmlForm.submitHtmlForm(); |
| 97 | + }) |
| 98 | + |
| 99 | + }); |
| 100 | + </script> |
| 101 | + </ifMode> |
| 102 | + |
| 103 | + <div class="htmlform" style="display:none"> |
| 104 | + <ifMode mode="VIEW" include="false"> |
| 105 | + <h2><uimessage code="ui.i18n.EncounterType.name.c31d3312-40c4-11e7-a919-92ebcb67fe33"/></h2> |
| 106 | + |
| 107 | + <!-- users with retroConsultNote privilege can edit provider, location, and date for both retro and active visits --> |
| 108 | + <includeIf velocityTest="$user.hasPrivilege('Task: emr.retroConsultNote')"> |
| 109 | + <div id="who-when-where"> |
| 110 | + <p id="who"> |
| 111 | + <label><uimessage code="emr.patientDashBoard.providerRequired"/></label> |
| 112 | + <span><encounterProviderAndRole default="currentUser" encounterRole="4f10ad1a-ec49-48df-98c7-1391c6ac7f05" required="true"/></span> |
| 113 | + </p> |
| 114 | + <p id="where"> |
| 115 | + <label><uimessage code="emr.locationRequired"/></label> |
| 116 | + <span><encounterLocation default="SessionAttribute:emrContext.sessionLocationId" tags="HIV Consult Location"/></span> |
| 117 | + </p> |
| 118 | + <p id="when"> |
| 119 | + <label><uimessage code="emr.patientDashBoard.date"/></label> |
| 120 | + <span><encounterDate id="encounterDate" default="now" /></span> |
| 121 | + </p> |
| 122 | + </div> |
| 123 | + </includeIf> |
| 124 | + <!-- users with retroConsultNoteThisProviderOnly can edit location and date (but not provider) for retro visits --> |
| 125 | + <includeIf velocityTest="$user.hasPrivilege('Task: emr.retroConsultNoteThisProviderOnly') and !($user.hasPrivilege('Task: emr.retroConsultNote')) and (!$visit.open)"> |
| 126 | + <div style="display:none"> |
| 127 | + <encounterProviderAndRole default="currentUser" encounterRole="4f10ad1a-ec49-48df-98c7-1391c6ac7f05" required="true"/> |
| 128 | + </div> |
| 129 | + |
| 130 | + <div id="who-when-where"> |
| 131 | + <p id="who"> |
| 132 | + <label><uimessage code="emr.patientDashBoard.provider"/></label> |
| 133 | + <span><lookup expression="user.person.personName" /></span> |
| 134 | + </p> |
| 135 | + <p id="where"> |
| 136 | + <label><uimessage code="emr.locationRequired"/></label> |
| 137 | + <span><encounterLocation default="SessionAttribute:emrContext.sessionLocationId" tags="HIV Consult Location"/></span> |
| 138 | + </p> |
| 139 | + <p id="when"> |
| 140 | + <label><uimessage code="emr.patientDashBoard.date"/></label> |
| 141 | + <span><encounterDate id="encounterDate" default="now" /></span> |
| 142 | + </p> |
| 143 | + </div> |
| 144 | + |
| 145 | + </includeIf> |
| 146 | + <!-- all users that don't have retroConsultNote privilege cannot edit provider, location or date when active visit --> |
| 147 | + <includeIf velocityTest="(!$user.hasPrivilege('Task: emr.retroConsultNote')) and ($visit.open)"> |
| 148 | + <div style="display:none"> |
| 149 | + <encounterProviderAndRole default="currentUser" encounterRole="4f10ad1a-ec49-48df-98c7-1391c6ac7f05" required="true"/> |
| 150 | + <encounterLocation default="SessionAttribute:emrContext.sessionLocationId"/> |
| 151 | + <encounterDate id="encounterDate" default="now" /> |
| 152 | + </div> |
| 153 | + <div id="who-when-where"> |
| 154 | + <table id="who-where-when-view"> |
| 155 | + <tr> |
| 156 | + <td> |
| 157 | + <label><uimessage code="emr.patientDashBoard.provider"/></label> |
| 158 | + <span><lookup complexExpression="#if($encounter) $ui.format($encounter.provider) #else $ui.format($user.person) #end"/></span> |
| 159 | + </td> |
| 160 | + <td> |
| 161 | + <label><uimessage code="emr.location"/></label> |
| 162 | + <span><lookup complexExpression="#if($encounter) $ui.format($encounter.location) #else $ui.format($sessionContext.sessionLocation) #end"/></span> |
| 163 | + </td> |
| 164 | + <td> |
| 165 | + <label><uimessage code="emr.patientDashBoard.date"/></label> |
| 166 | + <span><lookup complexExpression="#if($encounter) $ui.format($fn.startOfDay($encounter.encounterDatetime)) #else $ui.format($fn.startOfDay($formGeneratedDatetime)) #end"/></span> |
| 167 | + </td> |
| 168 | + </tr> |
| 169 | + </table> |
| 170 | + </div> |
| 171 | + </includeIf> |
| 172 | + </ifMode> |
| 173 | + |
| 174 | + <ifMode mode="VIEW" include="false"> |
| 175 | + <div id="buttons"> |
| 176 | + <button id="next" type="button" class="submitButton confirm right"><uimessage code="emr.next"/><i class="icon-spinner icon-spin icon-2x" style="display: none; margin-left: 10px;"></i></button> |
| 177 | + <button id="submit" class="submitButton confirm right"><uimessage code="mirebalais.save"/><i class="icon-spinner icon-spin icon-2x" style="display: none; margin-left: 10px;"></i></button> |
| 178 | + <button id="cancel" type="button" class="cancel"><uimessage code="emr.cancel"/></button> |
| 179 | + </div> |
| 180 | + </ifMode> |
| 181 | + </div> |
| 182 | + |
| 183 | +</htmlform> |
| 184 | + |
0 commit comments