-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
107 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { View, type ViewProps } from 'react-native'; | ||
import { cn } from '@/utils/cn'; | ||
|
||
export const Skeleton = ({ className, ...props }: ViewProps) => { | ||
return <View className={cn('bg-muted animate-pulse rounded-md', className)} {...props} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { View } from 'react-native'; | ||
import { getVaccineName } from '@/fhirpath/immunization'; | ||
|
||
import { type Immunization } from '@canvas-challenge/canvas'; | ||
|
||
import { Text } from '../atoms/Text'; | ||
|
||
export const ImmunizationDetail = ({ immunization }: { immunization: Immunization }) => { | ||
const vaccineName = getVaccineName(immunization); | ||
|
||
return ( | ||
<View> | ||
<Text className="text-xl">{vaccineName}</Text> | ||
</View> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import fhirpath from 'fhirpath'; | ||
|
||
import { type Immunization } from '@canvas-challenge/canvas'; | ||
|
||
export function getVaccineName(immunization: Immunization): string | null { | ||
const [display] = fhirpath.evaluate( | ||
immunization, | ||
'vaccineCode.coding.first().display', | ||
) as string[]; | ||
|
||
return display ?? null; | ||
} | ||
|
||
export function getVaccineDateString(immunization: Immunization): string | null { | ||
const [dateString] = fhirpath.evaluate(immunization, 'occurrenceDateTime') as string[]; | ||
|
||
return dateString ?? null; | ||
} |