Skip to content

Commit

Permalink
Merge pull request #56 from bcgov/5889-coverage-remove-patient-restri…
Browse files Browse the repository at this point in the history
…ction

Removed patient restriction checkbox.
  • Loading branch information
weskubo-cgi authored Mar 4, 2022
2 parents 4385e38 + 2b60cdb commit 411b878
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 169 deletions.
31 changes: 19 additions & 12 deletions frontend/src/components/ui/AppCheckbox.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
<script setup>
import AppInputError from './AppInputError.vue'
</script>

<template>
<label class="checkbox">
{{ label }}
<input type="checkbox" :checked="modelValue"
@change="$emit('update:modelValue', $event.target.checked)" v-bind="$attrs"/>
<input type="checkbox" :checked="modelValue" @change="$emit('update:modelValue', $event.target.checked)" v-bind="$attrs" />
<span class="checkmark"></span>

</label>

<div class="error-text" v-for="error in errorValue.$errors">{{ error.$message.replace('Value', label) }}</div>
<AppInputError :e-model="eModel" :label="label" />
</template>

<script>
export default {
name: 'AppCheckbox',
props: {
errorValue: Object,
eModel: {
type: Object,
required: false,
},
label: String,
modelValue: Boolean,
},
computed: {
inputClass() {
return {
'text_input': true,
'error-input': this.errorValue.$error,
text_input: true,
'error-input': this.eModel?.$error,
}
}
}
},
},
}
</script>
<style scoped>
/* Customize the label (the container) */
.checkbox {
display: block;
Expand Down Expand Up @@ -72,7 +76,7 @@ export default {
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
content: "\2713";
content: '\2713';
color: white;
position: absolute;
left: 50%;
Expand All @@ -86,4 +90,7 @@ export default {
display: block;
}
</style>
.error-input {
border-color: #d8292f !important;
}
</style>
118 changes: 52 additions & 66 deletions frontend/src/views/eligibility/CoverageStatusCheck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
</AppRow>
<AppRow>
<AppCol class="col3">
<AppDateInput :e-model="v$.dateOfBirth" id="dateOfBirth" label="Date Of Birth" v-model="dateOfBirth"/>
<AppDateInput :e-model="v$.dateOfBirth" id="dateOfBirth" label="Date Of Birth" v-model="dateOfBirth" />
</AppCol>
</AppRow>
<AppRow>
<AppCol class="col3">
<AppDateInput :e-model="v$.dateOfService" id ="dateOfService" label="Date Of Service" v-model="dateOfService" />
<AppDateInput :e-model="v$.dateOfService" id="dateOfService" label="Date Of Service" v-model="dateOfService" />
</AppCol>
</AppRow>
<AppRow>
Expand All @@ -22,9 +22,8 @@
<p>Select by clicking one or more boxes</p>
</AppCol>
<AppCol>
<AppCheckbox :errorValue="v$.checkSubsidyInsuredService" id="checkSubsidyInsuredService" label="Check for Subsidy Insured Service" v-model="checkSubsidyInsuredService"/>
<AppCheckbox :errorValue="v$.checkLastEyeExam" id="checkLastEyeExam" label="Check for Last Eye Exam" v-model="checkLastEyeExam"/>
<AppCheckbox :errorValue="v$.checkPatientRestriction" id="checkPatientRestriction" label="Check for Patient Restriction" v-model="checkPatientRestriction"/>
<AppCheckbox id="checkSubsidyInsuredService" label="Check for Subsidy Insured Service" v-model="checkSubsidyInsuredService" />
<AppCheckbox id="checkLastEyeExam" label="Check for Last Eye Exam" v-model="checkLastEyeExam" />
</AppCol>
</AppRow>
<AppRow>
Expand All @@ -38,63 +37,57 @@
<hr />
<AppRow>
<AppCol class="col3">
<AppOutput label="PHN" :value="result.phn"/>
<AppOutput label="PHN" :value="result.phn" />
</AppCol>
<AppCol class="col3">
<AppOutput label="Name" :value="fullName"/>
<AppOutput label="Name" :value="fullName" />
</AppCol>
<AppCol class="col3">
<AppOutput label="Birth Date" :value="result.dateOfBirth"/>
<AppOutput label="Birth Date" :value="result.dateOfBirth" />
</AppCol>
<AppCol class="col3">
<AppOutput label="Gender" :value="gender"/>
<AppOutput label="Gender" :value="gender" />
</AppCol>
</AppRow>
<AppRow>
<AppCol class="col3">
<AppOutput label="Date Of Service" :value="result.dateOfService"/>
<AppOutput label="Date Of Service" :value="result.dateOfService" />
</AppCol>
<AppCol class="col3">
<AppOutput label="Eligible on Date of Service?" :value="eligibleOnDateOfService"/>
<AppOutput label="Eligible on Date of Service?" :value="eligibleOnDateOfService" />
</AppCol>
<AppCol class="col3">
<AppOutput label="Coverage End Date" :value="result.coverageEndDate"/>
<AppOutput label="Coverage End Date" :value="result.coverageEndDate" />
</AppCol>
<AppCol class="col3">
<AppOutput label="Coverage End Reason" :value="coverageEndReason"/>
<AppOutput label="Coverage End Reason" :value="coverageEndReason" />
</AppCol>
</AppRow>
<br/>
</AppRow>
<br />
<AppCard id="patientStatusRequest" v-if="isPatientStatusRequest">
<AppRow class="row" v-if="result.subsidyInsuredService">
<AppRow class="row" v-if="result.subsidyInsuredService">
<AppCol class="col12">
<p>
<label>Subsidy Insured Service: </label>{{ subsidyInsuredService }}
</p>
</AppCol>
<p><label>Subsidy Insured Service: </label>{{ subsidyInsuredService }}</p>
</AppCol>
</AppRow>
<AppRow class="row" v-if="result.dateOfLastEyeExamination">
<AppRow class="row" v-if="result.dateOfLastEyeExamination">
<AppCol class="col12">
<p>
<label>Date of Last Eye Examination: </label>{{ dateOfLastEyeExamination }}
</p>
<p><label>Date of Last Eye Examination: </label>{{ dateOfLastEyeExamination }}</p>
</AppCol>
</AppRow>
<AppRow class="row" v-if="result.patientRestriction">
<AppRow class="row" v-if="result.patientRestriction">
<AppCol class="col12">
<p>
<label>Patient Restriction: </label>{{ patientRestriction }}
</p>
</AppCol>
<p><label>Patient Restriction: </label>{{ patientRestriction }}</p>
</AppCol>
</AppRow>
</AppCard>

<AppCard id="careCardWarning" v-if="result.careCardWarning">
<p>{{result.careCardWarning}}</p>
<p>{{ result.careCardWarning }}</p>
</AppCard>

<AppCard id="clientInstructions" v-if="result.clientInstructions">
<p>{{result.clientInstructions}}</p>
<p>{{ result.clientInstructions }}</p>
</AppCard>
</div>
</template>
Expand All @@ -114,7 +107,8 @@ export default {
components: { AppCard, AppCheckbox },
setup() {
return {
v$: useVuelidate()}
v$: useVuelidate(),
}
},
data() {
return {
Expand All @@ -123,7 +117,6 @@ export default {
dateOfService: new Date(),
checkSubsidyInsuredService: false,
checkLastEyeExam: false,
checkPatientRestriction: false,
searching: false,
searchOk: false,
result: {
Expand All @@ -134,7 +127,7 @@ export default {
dateOfBirth: '',
gender: '',
dateOfService: '',
eligibleOnDateOfService: false,
eligibleOnDateOfService: false,
coverageEndDate: '',
coverageEndReason: '',
subsidyInsuredService: '',
Expand All @@ -144,7 +137,7 @@ export default {
clientInstructions: '',
status: '',
message: '',
}
},
}
},
computed: {
Expand Down Expand Up @@ -196,7 +189,7 @@ export default {
dateOfLastEyeExamination() {
switch (this.result.dateOfLastEyeExamination) {
case 'N':
return 'MSP HAS NOT PAID FOR AN EYE EXAM FOR THIS PHN IN THE LAST 24 MTHS FROM TODAY\'S DATE'
return "MSP HAS NOT PAID FOR AN EYE EXAM FOR THIS PHN IN THE LAST 24 MTHS FROM TODAY'S DATE"
case 'ERROR':
return 'EYE SYSTEM UNAVAILABLE'
default:
Expand All @@ -208,34 +201,37 @@ export default {
case 'Y':
return 'SEE MSP BULLETIN'
case 'N':
return 'NO RESTRICTION'
return 'NO RESTRICTION'
case 'ERROR':
return 'UNAVAILABLE - CONTACT MSP'
default:
return this.result.patientRestriction
}
}
},
},
methods: {
async submitForm() {
this.result = null
this.searching = true
this.searchOk = false
this.$store.commit("alert/dismissAlert")
this.$store.commit('alert/dismissAlert')
try {
const isValid = await this.v$.$validate()
if (!isValid) {
this.showError()
return
}
this.result = (await EligibilityService.checkCoverageStatus({
phn: this.phn,
dateOfBirth: dayjs(this.dateOfBirth).format(API_DATE_FORMAT),
dateOfService: dayjs(this.dateOfService).format(API_DATE_FORMAT),
checkSubsidyInsuredService: this.checkSubsidyInsuredService,
checkLastEyeExam: this.checkLastEyeExam,
checkPatientRestriction: this.checkPatientRestriction})).data
this.result = (
await EligibilityService.checkCoverageStatus({
phn: this.phn,
dateOfBirth: dayjs(this.dateOfBirth).format(API_DATE_FORMAT),
dateOfService: dayjs(this.dateOfService).format(API_DATE_FORMAT),
checkSubsidyInsuredService: this.checkSubsidyInsuredService,
checkLastEyeExam: this.checkLastEyeExam,
checkPatientRestriction: false,
})
).data
if (this.result.status === 'error') {
this.$store.commit('alert/setErrorAlert', this.result.message)
return
Expand All @@ -245,9 +241,8 @@ export default {
if (this.result.status === 'success') {
this.$store.commit('alert/setSuccessAlert', this.result.message || 'Transaction successful')
} else if (this.result.status === 'warning') {
this.$store.commit('alert/setWarningAlert', this.result.message)
}
this.$store.commit('alert/setWarningAlert', this.result.message)
}
} catch (err) {
this.$store.commit('alert/setErrorAlert', `${err}`)
} finally {
Expand All @@ -265,34 +260,25 @@ export default {
this.dateOfService = new Date()
this.checkSubsidyInsuredService = false
this.checkLastEyeExam = false
this.checkPatientRestriction = false
this.result = null
this.v$.$reset()
this.$store.commit("alert/dismissAlert")
this.$store.commit('alert/dismissAlert')
this.searchOk = false
this.searching = false
}
},
},
validations() {
return {
phn: {
required,
validatePHN: helpers.withMessage(
VALIDATE_PHN_MESSAGE, validatePHN
)
validatePHN: helpers.withMessage(VALIDATE_PHN_MESSAGE, validatePHN),
},
dateOfBirth: {
dateOfBirth: {
required,
validateDOB: helpers.withMessage(
VALIDATE_DOB_MESSAGE, validateDOB
)
validateDOB: helpers.withMessage(VALIDATE_DOB_MESSAGE, validateDOB),
},
dateOfService: { required },
checkSubsidyInsuredService: {},
checkLastEyeExam: {},
checkPatientRestriction: {},
}
}
},
}
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class CoverageStatusCheck {
this.dateOfServiceInput = Selector('#dp-input-dateOfService')
this.subsidyInsuredServiceCheckBox = Selector('#checkSubsidyInsuredService', { timeout: 1000 })
this.dateOfLastEyeExaminationCheckBox = Selector('#checkLastEyeExam', { timeout: 1000 })
this.patientRestrictionCheckBox = Selector('#checkPatientRestriction', { timeout: 1000 })
this.errorText = Selector('div').withAttribute('class', 'error-text')

this.submitButton = Selector('button[type="submit"]')
Expand Down
Loading

0 comments on commit 411b878

Please sign in to comment.