pub struct PatientService { /* private fields */ }Expand description
Pure patient data operations - no API concerns
Implementations§
Source§impl PatientService
impl PatientService
Sourcepub fn new(cfg: Arc<CoreConfig>) -> Self
pub fn new(cfg: Arc<CoreConfig>) -> Self
Creates a new instance of PatientService.
§Returns
A new PatientService instance ready to handle patient operations.
Sourcepub fn initialise_full_record(
&self,
author: Author,
care_location: NonEmptyText,
given_names: Vec<NonEmptyText>,
last_name: NonEmptyText,
birth_date: NaiveDate,
namespace: Option<NonEmptyText>,
) -> PatientResult<FullRecord>
pub fn initialise_full_record( &self, author: Author, care_location: NonEmptyText, given_names: Vec<NonEmptyText>, last_name: NonEmptyText, birth_date: NaiveDate, namespace: Option<NonEmptyText>, ) -> PatientResult<FullRecord>
Initialises a complete patient record with demographics and clinical components.
This function creates both a demographics repository and a clinical repository, links them together, and populates the demographics with the provided patient information.
§Arguments
author- The author information for Git commits.given_names- A vector of the patient’s given names.last_name- The patient’s family/last name.birth_date- The patient’s date of birth.namespace- Optional namespace for the clinical-demographics link.
§Returns
Returns a FullRecord containing both UUIDs on success.
§Errors
Returns a PatientError if:
- demographics initialisation or update fails,
- clinical initialisation fails,
- linking clinical to demographics fails.
Trait Implementations§
Source§impl Clone for PatientService
impl Clone for PatientService
Source§fn clone(&self) -> PatientService
fn clone(&self) -> PatientService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PatientService
impl RefUnwindSafe for PatientService
impl Send for PatientService
impl Sync for PatientService
impl Unpin for PatientService
impl UnwindSafe for PatientService
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request