davebronson/clear-hl7-net

Implement methods for HL7 Type classes that aid in initializing instance values

davebronson opened this issue · 1 comments

It would be helpful in some scenarios to simplify the initialization of an HL7 Type class instance. Take the following snippet where we add a new address to a PatientAddress collection:

PatientAddress = new ExtendedAddress[]
{
    new ExtendedAddress
    {
        StreetAddress = new StreetAddress { StreetOrMailingAddress = "123 Main Street" },
        City = "Anywhere",
        StateOrProvince = "FL",
        ZipOrPostalCode = "33333"
    }
}

In predictable scenarios it would be simpler to:

PatientAddress = new ExtendedAddress[]
{
    new ExtendedAddress().WithInit("123 Main Street", "Anywhere", "FL", "33333")
}

or:

PatientAddress = new ExtendedAddress[]
{
    extendedAddressRepo.Create("123 Main Street", "Anywhere", "FL", "33333")
}

Other obvious examples that could benefit from this include: ExtendedPersonName (first + last name), PersonLocation (Room + Bed + Facility).

Changes released in V2.0.0.