NINS_CODE/bahmniapps/registration/views/patientRelationships.html
travelershot 70dda814aa codepush
2024-12-12 22:37:39 +06:00

75 lines
5.6 KiB
HTML

<div class="relationships-container form">
<div class="history-relationship">
<div class="row" ng-repeat="relationship in patient.relationships track by $index" ng-hide="relationship.voided">
<div class="col col1">
<span>{{getRelationshipTypeForDisplay(relationship)}}</span>
</div>
<div class="col col2">
<span>{{getRelatedToPersonForDisplay(relationship)}}</span>
<span ng-if="isPatientRelationship(relationship)"><a ng-click="openPatientDashboardInNewTab(relationship)"><i class="fa fa-external-link"></i></a></span>
</div>
<div class="col col3">
<strong class="till-text">{{ ::'REGISTRATION_LABEL_TILL' | translate}}</strong>
<span>{{relationship.endDate | bahmniDate}}</span>
</div>
<div class="col col4">
<button type="button" class="small-btn row-remover" ng-confirm-click="removeRelationship(relationship)" id="relationRemoveBtn">
<span class="fa fa-remove"></span>
</button>
</div>
</div>
</div>
<div class="new-relationship">
<div class="row" ng-repeat="newRelationship in patient.newlyAddedRelationships">
<div class="col col1 form-field">
<div class="field-attribute showOn-small-screen">
<label>{{ 'REGISTRATION_RELATION_TYPE_LABEL'|translate }}
<span class="asterick">*</span>
</label>
</div>
<div class="field-value">
<select ng-model="newRelationship.relationshipType.uuid" ng-options="type.uuid as type.aIsToB for type in ::relationshipTypes" ng-change="clearRelationshipRow(newRelationship, $index);">
<option value="">{{ ::'REGISTRATION_LABEL_SELECT_RELATIONSHIP_TYPE' | translate}}</option>
</select>
</div>
<span class="asterick showOn-desktop">*</span>
</div>
<div class="col col2 form-field">
<div class="field-attribute showOn-small-screen">
<label>{{ 'REGISTRATION_ENTER_NAME_ID_LABEL'|translate }}
<span class="asterick">*</span>
</label>
</div>
<div class="field-value" ng-switch="getChosenRelationshipType(newRelationship)">
<input type="text" ng-switch-when="patient" bahmni-autocomplete validation-message="{{ ::'REGISTRATION_LABEL_PATIENT_AUTOCOMPLETE_LIST' | translate}}" on-edit="onEdit(newRelationship)" ng-model="newRelationship.patientIdentifier" response-map="getPatientList" source="searchByPatientIdentifierOrName" ng-change="clearPatient(newRelationship)" on-select="patientSelected(newRelationship)" placeholder="{{ ::'REGISTRATION_LABEL_ENTER_NAME_ID' | translate}}" ng-class="{'illegalValue': !newRelationship.personB.uuid||duplicateRelationship(newRelationship)}" is-invalid="isInvalidRelation(newRelationship)"/>
<input type="text" ng-switch-when="provider" bahmni-autocomplete is-invalid="isInvalidRelation(newRelationship)" ng-class="{'illegalValue': !newRelationship.personB.uuid || duplicateRelationship(newRelationship)}" validation-message="{{ ::'REGISTRATION_LABEL_PROVIDER_AUTOCOMPLETE_LIST' | translate}}" on-edit="onEdit(newRelationship)" ng-model="newRelationship.providerName" response-map="getProviderDataResults" source="getProviderList(relationship)" ng-change="clearProvider(newRelationship)" on-select="providerSelected(newRelationship)" placeholder="{{ ::'REGISTRATION_LABEL_ENTER_NAME' | translate}}"/>
<input type="text" ng-switch-default ng-model-options="{updateOn: 'blur'}" ng-model="newRelationship.patientIdentifier" ng-change="searchByPatientIdentifier(newRelationship)" ng-disabled="!newRelationship.relationshipType.uuid" placeholder="{{ ::'REGISTRATION_LABEL_ENTER_NAME_ID' | translate}}"/>
<input type="hidden" ng-model="newRelationship.personB"/>
</div>
<span class="asterick showOn-desktop">*</span>
<span class="no-person" ng-show="showPersonNotFound(newRelationship)">{{ ::'REGISTRATION_LABEL_PERSON_NOT_FOUND' | translate}}</span>
<span ng-show="!showPersonNotFound(newRelationship)">{{newRelationship.content}}</span>
<span class="no-person" ng-show="duplicateRelationship(newRelationship)">{{ ::'REGISTRATION_LABEL_RELATIONSHIP_EXISTS' | translate}}</span>
</div>
<div class="col col3 form-field">
<strong class="till-text">{{ ::'REGISTRATION_LABEL_TILL' | translate}}</strong>
<div class="field-attribute showOn-small-screen">
<label>Till Date</label>
</div>
<div class="field-value">
<input type="date" ng-model="newRelationship.endDate" ng-disabled="!newRelationship.relationshipType.uuid"/>
</div>
</div>
<div class="col col4">
<button type="button" class="small-btn row-remover" ng-if="!isEmpty(newRelationship)" ng-click="removeRelationship(newRelationship, $index)">
<span class="fa fa-remove"></span>
</button>
</div>
</div>
</div>
</div>