Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8305-dateofdeath-ind implementation #162

Merged
merged 10 commits into from
Jan 26, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class FindCandidatesConverter {

private static final String IDENTIFIER_TYPE_CODE = "PH";
private static final String ASSIGNING_AUTHORITY = "BC";
private static final String NOT_APPLICABLE = "N/A";
private static final Logger logger = LoggerFactory.getLogger(FindCandidatesConverter.class);

public FindCandidatesRequest convertRequest(NameSearchRequest nameSearchRequest) {
Expand Down Expand Up @@ -133,7 +134,7 @@ private List<NameSearchResult> buildNameSearch(FindCandidatesResponse findCandid
nameSearchResult.setDateOfBirth(birthDate);
}

String dateOfDeath = person.getDeathDate() != null ? V3MessageUtil.convertDateToString(person.getDeathDate()) : "N/A";
String dateOfDeath = person.getDeathDate() != null ? V3MessageUtil.convertDateToString(person.getDeathDate()) : NOT_APPLICABLE;
nameSearchResult.setDateOfDeath(dateOfDeath);

nameSearchResult.setGender(person.getGender());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class GetDemographicsConverter {

private static final Logger logger = LoggerFactory.getLogger(GetDemographicsConverter.class);
private static final String MRN_SOURCE = "MOH_CRS";
private static final String NOT_APPLICABLE = "N/A";

/**
* @param phn
Expand Down Expand Up @@ -117,7 +118,7 @@ private void buildPersonDetails(GetDemographicsResponse demographicsResponse,
personDetailsResponse.setDateOfBirth(birthDate);
}

String dateOfDeath = person.getDeathDate() != null ? V3MessageUtil.convertDateToString(person.getDeathDate()) :"N/A";
String dateOfDeath = person.getDeathDate() != null ? V3MessageUtil.convertDateToString(person.getDeathDate()) : NOT_APPLICABLE;
personDetailsResponse.setDateOfDeath(dateOfDeath);

personDetailsResponse.setGender(person.getGender());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</AppCol>
<AppCol class="col6">
<span>{{ formatDetailsLine1 }}</span>
<span>{{ formatDetailsLine2 }}</span>
<span v-html="formatDetailsLine2"></span>
<span>{{ formatDetailsLine3 }}</span>
</AppCol>
<AppCol class="col1">
Expand Down Expand Up @@ -53,6 +53,15 @@ export default {
return ''
}
},
formatDetailsLine2() {
let details = ''

if (this.candidate.dateOfDeath && this.candidate.dateOfDeath != 'N/A') {
details = `${details} <span class = "text-red"> ${this.candidate.dateOfDeath}</span>`
}

return details
},
weskubo-cgi marked this conversation as resolved.
Show resolved Hide resolved
formatDetailsLine2() {
let details = ''
if (this.candidate.gender) {
Expand All @@ -62,7 +71,7 @@ export default {
details = details + ' ' + this.candidate.dateOfBirth
}
if (this.candidate.dateOfDeath && this.candidate.dateOfDeath != 'N/A') {
weskubo-cgi marked this conversation as resolved.
Show resolved Hide resolved
details = details + ' ' + this.candidate.dateOfDeath
details = `${details} <span class = "text-red"> ${this.candidate.dateOfDeath}</span>`
weskubo-cgi marked this conversation as resolved.
Show resolved Hide resolved
}
if (this.candidate.phn) {
details = details + ' ' + this.candidate.phn
Expand All @@ -73,6 +82,7 @@ export default {
if (this.candidate.identifierTypeCode) {
details = details + ' ' + this.candidate.identifierTypeCode
}

return details
},
formatDetailsLine3() {
Expand Down Expand Up @@ -145,3 +155,9 @@ export default {
},
}
</script>
<style>
.text-deceased {
color: red;
font-weight: bold;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</AppCol>
</AppRow>
<div v-if="deceased">
<AppRow class="text-red">
<AppRow class="text-deceased">
<AppCol class="col3">
<AppOutput label="Date of Death" :value="resident?.dateOfDeath" />
</AppCol>
Expand Down Expand Up @@ -414,7 +414,7 @@ export default {
}
</script>
<style scoped>
.text-red {
.text-deceased {
weskubo-cgi marked this conversation as resolved.
Show resolved Hide resolved
color: red;
weskubo-cgi marked this conversation as resolved.
Show resolved Hide resolved
}
</style>