@uxland-admin/ip-patient-header
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -28,5 +28,6 @@ import isAsyncStateStale from "@uxland/uxl-redux/is-async-stale"; | ||
if (isAsyncStateStale(currentPlan)) { | ||
return asyncAction(FETCH_PATIENT_HEADER, () => icsFetchClient.fetch(`/patient/${patientContext.patient}`), store); | ||
let uri = `/patient/${patientContext.center}/${patientContext.patient}/${patientContext.case}/${patientContext.movement}/header`; | ||
return asyncAction(FETCH_PATIENT_HEADER, () => icsFetchClient.fetch(uri), store); | ||
} | ||
} | ||
}; |
import { html } from '@polymer/lit-element/lit-element'; | ||
import { when } from 'lit-html/directives/when'; | ||
const innerTemplate = (props) => html ` | ||
${when(props.patientData.name, () => html ` | ||
${props.patientData && props.patientData.name ? | ||
html ` | ||
<div class="patient-header-container"> | ||
<p class="username">${props.patientData.name} ${props.patientData.firstSurname} ${props.patientData.secondSurname}</p> | ||
<p class="userData">${props.localize(props.patientData.gender == 'male' ? 'ip-patient-header.patientData.genderMale' : 'ip-patient-header.patientData.genderFemale')}, ${props.computeRelativeTime(props.patientData.birthDate)}</p> | ||
</div>`, () => html ``)}`; | ||
</div>` : html ``} | ||
`; | ||
export const template = innerTemplate; |
{ | ||
"name": "@uxland-admin/ip-patient-header", | ||
"description": "ICS Process - Patient Header", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
import createAsyncReducer from "@uxland/uxl-redux/create-async-reducer"; | ||
import { actionsBuilder } from "../../constants"; | ||
export const FETCH_PATIENT_HEADER = actionsBuilder('fetch-patient-header'); | ||
export const reducer = createAsyncReducer(FETCH_PATIENT_HEADER, { defValue: {} }); | ||
export const reducer = createAsyncReducer(FETCH_PATIENT_HEADER); |
13116
219