Class KVNR

All Implemented Interfaces:
WithChecksum

public class KVNR extends SemanticValue<String,DeBasisProfilNamingSystem> implements WithChecksum
Represents a Krankenversichertennummer (KVNR), a German health insurance number. This class provides methods to generate, validate, and manipulate KVNRs.

KVNRs are used to uniquely identify individuals in the German health insurance system. They consist of a leading capital letter, followed by 8 digits, and a check number.

For more information, see Krankenversichertennummer.

This class supports both GKV (statutory health insurance) and PKV (private health insurance) systems, and provides methods to generate random KVNRs for both systems.

Example usage:

     KVNR kvnr = KVNR.random();
     boolean isValid = kvnr.isValid();
 

Note: This class implements the WithChecksum interface to provide checksum validation.

See Also:
  • Method Details

    • getInsuranceType

      public InsuranceTypeDe getInsuranceType()
    • isGkv

      public boolean isGkv()
    • isPkv

      public boolean isPkv()
    • asReference

      public org.hl7.fhir.r4.model.Reference asReference(boolean withCoding)
    • asReference

      public org.hl7.fhir.r4.model.Reference asReference(DeBasisProfilNamingSystem system, boolean withCoding)
    • asIdentifier

      public org.hl7.fhir.r4.model.Identifier asIdentifier()
      Overrides:
      asIdentifier in class SemanticValue<String,DeBasisProfilNamingSystem>
    • asIdentifier

      public org.hl7.fhir.r4.model.Identifier asIdentifier(boolean withCoding)
    • asIdentifier

      public org.hl7.fhir.r4.model.Identifier asIdentifier(DeBasisProfilNamingSystem system)
      Overrides:
      asIdentifier in class SemanticValue<String,DeBasisProfilNamingSystem>
    • asIdentifier

      public org.hl7.fhir.r4.model.Identifier asIdentifier(DeBasisProfilNamingSystem system, boolean withCoding)
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface WithChecksum
    • getChecksum

      public int getChecksum()
      Specified by:
      getChecksum in interface WithChecksum
    • random

      public static KVNR random()
    • randomPkv

      public static KVNR randomPkv()
    • randomGkv

      public static KVNR randomGkv()
    • asPkv

      public static KVNR asPkv(String value)
    • asGkv

      public static KVNR asGkv(String value)
    • from

      public static KVNR from(String value)
    • from

      public static KVNR from(DeBasisProfilNamingSystem namingSystem, String value)
    • from

      public static KVNR from(org.hl7.fhir.r4.model.Identifier identifier)
    • extractFrom

      public static Optional<KVNR> extractFrom(org.hl7.fhir.r4.model.Identifier identifier)
    • extractFrom

      public static Optional<KVNR> extractFrom(List<org.hl7.fhir.r4.model.Identifier> identifiers)
    • extractFromOrThrow

      public static <P extends org.hl7.fhir.r4.model.Resource> KVNR extractFromOrThrow(Class<P> parent, org.hl7.fhir.r4.model.Identifier identifier)
    • extractFromOrThrow

      public static <P extends org.hl7.fhir.r4.model.Resource> KVNR extractFromOrThrow(Class<P> parent, List<org.hl7.fhir.r4.model.Identifier> identifiers)
    • randomStringValue

      public static String randomStringValue()