public class LifeCARDObjectHandler
extends java.lang.Object
There are some methods like to check the card ID, get some values, to store and retrieve the LifeCARDObject by XML files.
Constructor and Description |
---|
LifeCARDObjectHandler(SEHRConfigurationObject sco)
Default constructor.
|
LifeCARDObjectHandler(SEHRConfigurationObject sco,
LifeCardItem lifeCardItem)
Constructor to work with given item object.
|
Modifier and Type | Method and Description |
---|---|
static LifeCardItem |
buildLifeCardItemFromLcMain(org.ifeth.sehr.intrasec.entities.LcMain lcMain,
javax.persistence.EntityManager em,
boolean isJTA)
Builds a LifeCardItem object from a given entity without a physical card
assignment.
|
static java.lang.String |
buildNumber(LifeCardItem lc,
java.lang.String cc,
java.lang.Integer zid,
java.lang.Integer cid,
java.lang.Integer patid)
Build the card number and store it to the given card item.
|
static void |
CardItemToJSONFile(LifeCardItem lc,
java.io.File outFile)
Write out the LifeCARD item object to a JSON formatted file.
|
static boolean |
checkCountryCode(LifeCardItem lifeCardItem) |
static boolean |
checkCountryCode(java.lang.String lcnumber) |
static java.io.File[] |
createLifeCARDImage(java.io.File fCardTemplate,
LifeCardItem item,
java.io.File fOut)
Creates a preview of the LifeCARD(R) as well as the overlay text for
printing purposes.
|
java.lang.Integer |
getCenterID() |
java.lang.String |
getCountry() |
java.lang.String |
getHandlerLifeCardVersion() |
LifeCardItem |
getItem()
Get the item (card data object) we are currently processing.
|
java.lang.Integer |
getPatientID() |
java.lang.Integer |
getZoneID() |
static boolean |
isSyntaxC778(java.lang.String lcid) |
static LifeCardItem |
JSONFileToCardItem(java.io.File inFile)
Get LifeCARD item object from a JSON file.
|
static java.util.Map<java.lang.Short,java.lang.String> |
listIdentConstants()
List of identity papers for selection purposes.
|
static java.util.Map<java.lang.Short,java.lang.String> |
listStsConstants()
List of LcMain status values for selection purposes.
|
static void |
ObjectToXML(LifeCardItem lc,
java.io.File xmlOutFile) |
LifeCardItem |
searchDirContext(SEHRDirectoryContext ctx,
java.lang.String lcnr)
Search for entry at the given SEHRContext.
|
void |
setLifeCardItem(LifeCardItem lifeCardItem)
Set the item to work with.
|
short |
storeObject2DirContext(SEHRDirectoryContext ctx)
Store the LifeCARD reference object to the given SEHR provider context.
|
static boolean |
verifySerialCard(java.lang.String usbSerial,
org.ifeth.sehr.intrasec.entities.LcCad lcCad)
Verify the serial of the card against the issued data set (LcCad).
|
static LifeCardItem |
XMLToObject(java.io.File xmlInFile) |
public LifeCARDObjectHandler(SEHRConfigurationObject sco)
The SEHRConfigurationObject
contains
the current zone settings. Important parameters (values) are
sco
- public LifeCARDObjectHandler(SEHRConfigurationObject sco, LifeCardItem lifeCardItem)
sco
- lifeCardItem
- LifeCARDObjectHandler(SEHRConfigurationObject sco)
public LifeCardItem getItem()
The item contains all printable and some not printable attributes.
public void setLifeCardItem(LifeCardItem lifeCardItem)
lifeCardItem
- The LifeCardItem
to setpublic java.lang.String getHandlerLifeCardVersion()
public java.lang.Integer getZoneID()
public java.lang.String getCountry()
public java.lang.Integer getCenterID()
public java.lang.Integer getPatientID()
public static java.lang.String buildNumber(LifeCardItem lc, java.lang.String cc, java.lang.Integer zid, java.lang.Integer cid, java.lang.Integer patid) throws GenericSEHRException
The card item does only contain the printed data on the card to reprint or to redistribute it. The item is part of the LcMain record to store the relation to the user (on the zone host) and usage status.
lc
- The card item object (to place the number)cc
- The country code (2-chars, e.g. DE)zid
- The zone idcid
- The center idpatid
- The patient id at the center, at the local EHR systemGenericSEHRException
public static LifeCardItem buildLifeCardItemFromLcMain(org.ifeth.sehr.intrasec.entities.LcMain lcMain, javax.persistence.EntityManager em, boolean isJTA)
If an JPA instance is given ('em' parameter), the DB record of the entity will be updated to store the generated item.
lcMain
- The DB record from which the item will be generatedem
- EntityManager (JPA of type RESOURCE_LOCAL or JTA) or 'null'isJTA
- set to 'true' if used inside a container like GF.public static LifeCardItem XMLToObject(java.io.File xmlInFile) throws GenericSEHRException
GenericSEHRException
public static void ObjectToXML(LifeCardItem lc, java.io.File xmlOutFile) throws GenericSEHRException
GenericSEHRException
public static boolean isSyntaxC778(java.lang.String lcid)
public static boolean checkCountryCode(LifeCardItem lifeCardItem)
public static boolean checkCountryCode(java.lang.String lcnumber)
public short storeObject2DirContext(SEHRDirectoryContext ctx)
By default an LDAP context of a local, regional or global acting SEHR provider should be used. The IFETH context can be used if the patient wants a global usage by the non-profit organization IFETH.
.ctx
- public LifeCardItem searchDirContext(SEHRDirectoryContext ctx, java.lang.String lcnr)
Because SEHR is openSource there may be other and private networks. By decision of the project committee the IFETH institute runs a global service. So the directory service to search in depends on the configuration.
ctx
- - SEHRDirectoryContext (interface)lcnr
- public static void CardItemToJSONFile(LifeCardItem lc, java.io.File outFile) throws GenericSEHRException
Use this method to create a file on a card for identification (personalization).
By SEHR convention there are two files on each card. The first one contains the same data printed on the card (.lifecard file) and the second file contains the LcCad entity (.serial) of the production to veriy the card against the chipset to identify recurrent abuse / misusage or just to verify the card againt the holder/context.
lc
- outFile
- GenericSEHRException
public static LifeCardItem JSONFileToCardItem(java.io.File inFile) throws GenericSEHRException
Use this method to get the item of personalization/registration.
By SEHR convention there are two files on each card. The first one contains the same data printed on the card (.lifecard file) and the second file contains the LcCad entity (.serial) of the production to veriy the card against the chipset to identify recurrent abuse / misusage or just to verify the card againt the holder/context.
inFile
- GenericSEHRException
public static boolean verifySerialCard(java.lang.String usbSerial, org.ifeth.sehr.intrasec.entities.LcCad lcCad)
To keep the integrity of a card reliable each card has to be registered. For such a registration a provider (issuer) of LifeCARDs is assigned to a SEHR zone using either the management tools of the zone (e.g. sehr-cas) or a self written application to manage the card serials, the patients and the personalization.
Each application accessing cards should be able to verify a card using a library, e.g. usb4java based on libusb 1.0. The supported plattforms for usb4java are Supported platforms are Linux (x86 32/64 bit, ARM 32 bit), OS X (x86 32/64 bit) and Windows (x86 32/64 bit).
usbSerial
- lcCad
- public static java.io.File[] createLifeCARDImage(java.io.File fCardTemplate, LifeCardItem item, java.io.File fOut) throws java.io.IOException
fCardTemplate
- base path of the card templateitem
- fOut
- if 'null' file is stored at '/[temp dir]/lc-[number].png'java.io.IOException
public static final java.util.Map<java.lang.Short,java.lang.String> listIdentConstants()
public static final java.util.Map<java.lang.Short,java.lang.String> listStsConstants()