com.mmm.cms.homehealth.io
Class Oasis_B_RecordUtil

java.lang.Object
  extended by com.mmm.cms.homehealth.io.Oasis_B_RecordUtil
All Implemented Interfaces:
OasisRecordConverterIF
Direct Known Subclasses:
Oasis_C_RecordUtil

public class Oasis_B_RecordUtil
extends java.lang.Object
implements OasisRecordConverterIF

This utility class provides conversions between OASIS-B data records and the HomeHealthRecord interface. It can be used in conjunction with the OasisRecordFactory, which queries this utility to determine if a specific OASIS record format can be converted using this utility.

See Also:
OasisReaderFactory

Field Summary
static java.text.DateFormat dateFormat
          numberic date formatter - yyyyMMdd
static IntegerFormat intFormat2
          2 digiti integer formatter
static IntegerFormat intFormat3
          3 digit integer formatter
protected static java.util.Hashtable<java.lang.String,java.lang.String> sharedObjects
           
protected static java.lang.String strDate
           
 
Constructor Summary
Oasis_B_RecordUtil()
           
 
Method Summary
 java.lang.StringBuilder convertFromHomeHealthRec(HomeHealthRecordIF homeHealthRecord)
          Converts an OASIS record extended from the HomeHealth Record to a String that is a continous set of characters, i.e.
 java.lang.StringBuilder convertFromHomeHealthRecDelimeted(HomeHealthRecordIF homeHealthRecord, java.lang.String delimiter)
          Converts an OASIS record extended from the HomeHealth Record to a String using the delimiter to separate the values
 HomeHealthRecordIF convertToHomeHealthRec(java.lang.String strRecord, int recNum)
          Converts a string to a Home Health record, using the 3 parameter converter
 HomeHealthRecordIF convertToHomeHealthRec(java.lang.String strRecord, int recNum, boolean skipPassthru)
          Converts an OASIS string record to an OASIS Body record using the generic Home Health Record interface.
 java.lang.String formatDiagnosisCode(Icd9DiagnosisCodeIF dxcode)
          Ensures that a diagnosis code is 7 character long, padded with spaces where necessary
 java.lang.String getSharedString(java.lang.String str)
          This method returns a String object that is already used for reading an Oasis record in order to reduce the memory required to process large data sets.
 boolean isRecordConvertable(java.lang.String record)
          Given an OASIS 1448 or 1446 length string, determines if the converter can actually convert the record to its supported object.
 java.lang.String justifyRight(java.lang.String str, int length, char fillchar)
          This method returns a String that is right justified for the given length.
 java.lang.StringBuilder toHeaderOasisRecDelimeted(java.lang.String delimiter)
          Builds a header record explaining the format of the OASIS record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

intFormat2

public static final IntegerFormat intFormat2
2 digiti integer formatter


intFormat3

public static final IntegerFormat intFormat3
3 digit integer formatter


dateFormat

public static final java.text.DateFormat dateFormat
numberic date formatter - yyyyMMdd


strDate

protected static final java.lang.String strDate

sharedObjects

protected static final java.util.Hashtable<java.lang.String,java.lang.String> sharedObjects
Constructor Detail

Oasis_B_RecordUtil

public Oasis_B_RecordUtil()
Method Detail

isRecordConvertable

public boolean isRecordConvertable(java.lang.String record)
Given an OASIS 1448 or 1446 length string, determines if the converter can actually convert the record to its supported object. This will check the Version_CD1 field for the following values: as well at the Date Assessment Completed. Ensuring that the record is on or before December 31, 2009. The Version_CD1 field starts at position 23 (offset 22), with a length of 12, Left justified, any letters must be upper case. The Date Assessment Complete starts at position 302 (offset 301), with a length of 8 and a format of YYYYMMDD.

Specified by:
isRecordConvertable in interface OasisRecordConverterIF
Parameters:
record -
Returns:

convertToHomeHealthRec

public HomeHealthRecordIF convertToHomeHealthRec(java.lang.String strRecord,
                                                 int recNum)
                                          throws java.text.ParseException
Converts a string to a Home Health record, using the 3 parameter converter

Specified by:
convertToHomeHealthRec in interface OasisRecordConverterIF
Parameters:
strRecord -
recNum -
Returns:
Throws:
java.text.ParseException
See Also:
static HomeHealthRecordIF convertToHomeHealthRec(String strRecord, int recNum, boolean skipPassthru) throws ParseException

convertToHomeHealthRec

public HomeHealthRecordIF convertToHomeHealthRec(java.lang.String strRecord,
                                                 int recNum,
                                                 boolean skipPassthru)
                                          throws java.text.ParseException
Converts an OASIS string record to an OASIS Body record using the generic Home Health Record interface. Since much of the OASIS information is not needed for Home Health grouping, this method can ignore them or store them with the record using the skipPassthru parameter

Specified by:
convertToHomeHealthRec in interface OasisRecordConverterIF
Parameters:
strRecord -
recNum -
skipPassthru -
Returns:
Throws:
java.text.ParseException

convertFromHomeHealthRec

public java.lang.StringBuilder convertFromHomeHealthRec(HomeHealthRecordIF homeHealthRecord)
Converts an OASIS record extended from the HomeHealth Record to a String that is a continous set of characters, i.e. no delimiter

Specified by:
convertFromHomeHealthRec in interface OasisRecordConverterIF
Parameters:
homeHealthRecord -
Returns:
See Also:
static StringBuilder convertFromHomeHealthRecDelimeted(HomeHealthRecordIF homeHealthRecord, String delimiter) {

convertFromHomeHealthRecDelimeted

public java.lang.StringBuilder convertFromHomeHealthRecDelimeted(HomeHealthRecordIF homeHealthRecord,
                                                                 java.lang.String delimiter)
Converts an OASIS record extended from the HomeHealth Record to a String using the delimiter to separate the values

Specified by:
convertFromHomeHealthRecDelimeted in interface OasisRecordConverterIF
Parameters:
homeHealthRecord -
delimiter -
Returns:

toHeaderOasisRecDelimeted

public java.lang.StringBuilder toHeaderOasisRecDelimeted(java.lang.String delimiter)
Builds a header record explaining the format of the OASIS record. Usually used at the top of a text file.

Specified by:
toHeaderOasisRecDelimeted in interface OasisRecordConverterIF
Parameters:
delimiter -
Returns:

formatDiagnosisCode

public java.lang.String formatDiagnosisCode(Icd9DiagnosisCodeIF dxcode)
Ensures that a diagnosis code is 7 character long, padded with spaces where necessary

Specified by:
formatDiagnosisCode in interface OasisRecordConverterIF
Parameters:
dxcode -
Returns:

justifyRight

public java.lang.String justifyRight(java.lang.String str,
                                     int length,
                                     char fillchar)
This method returns a String that is right justified for the given length.

Specified by:
justifyRight in interface OasisRecordConverterIF
Parameters:
str -
length -
Returns:

getSharedString

public java.lang.String getSharedString(java.lang.String str)
This method returns a String object that is already used for reading an Oasis record in order to reduce the memory required to process large data sets.

Specified by:
getSharedString in interface OasisRecordConverterIF
Parameters:
str -
Returns: