Classes and API
Description
Greenrain MNC implements its login in classes and API in the library with the following properties:
Namespace: Greenrain.Mnc.
Executable Name: greenrain.mnc.dll
Gender Assumptions
If patient gender is unknown, then Greenrain MNC sets the patient gender = female if the claim has:
At least one CPT Code for maternity, or
At least one ICD-10-CM Code for maternity.
Otherwise, the patient gender remains unknown.
Enum ErrorTypeEnum
Enum name: ErrorTypeEnum
Namespace: Greenrain.Connect
Access modifier: Public
Description: This enum describes the error type:
None = Error type is not defined.
Error = Type is the Error.
Warning = Type is the Warning.
Enum PostOfficeEnum
Enum name: PostOfficeEnum
Access modifier: Public
Description: This enum defines the type of Post Office to run MNC for:
Shafafiya = Shafafiya Post Office managed by the Department of Health in the Emirate of Abu Dhabi.
Dhpo = Dubai Health Post Office (DHPO) managed by Dubai Health Authority in the Emirate of Dubai.
Class MncSettings
Class name: MncSettings
Access modifier: Public
Description: This class is used to manage Greenrain MNC settings. It can be used to change global Greenrain MNC settings, as well as to override settings for a particular run of MNC checks.
Public members: refer to the table below.
Member Name | Data Type | Default Value | Description |
---|---|---|---|
CptAndIcd10cmCrosswalk | bool | True | The setting to turn on alerts from CPT and ICD10CM Crosswalk edits. |
NcciEdits | bool | True | The setting to turn on alerts from NCCI Edits edits. |
Icd10cmAgeGenderAndIncompleteCodesCrosswalk | bool | True | The setting to turn on alerts from ICD10CM, Age, Gender and Incomplete Codes Crosswalk edits. |
CptAgeAndGenderCrosswalk | bool | True | The setting to turn on alerts from CPT, Age and Gender Crosswalk edits. |
MaternityCheck | bool | True | The setting to turn on alerts from Maternity Checks. |
Public methods: refer to the table below.
Method Name | Return Data Type | Description |
---|---|---|
Save() | void | The method saves the settings. Do not call this method if you use non-default settings only for the particular run of MNC checks. |
Class ValidationResult
Class name: ValidationResult
Namespace: Greenrain.Connect
Access modifier: Public
Description:
This class represents error messages returned by the Greenrain MNC API.
Greenrain MNC API may return two types of data:
Alerts are generated from Medical Necessity Checks.
Exceptions described in the section Classes and API#Exceptions.
Public members: refer to the table below.
Member Name | Data Type | Default Value | Description |
---|---|---|---|
Code | int | 0 | The validation result code. A negative value means there are errors found. Zero or positive value means Greenrain MNC found no errors. |
Description | string | null | Description of the result. |
ErrorCollection | null | Collection of error messages. |
Public methods: refer to the table below.
Method Name | Return Data Type | Description |
---|---|---|
IsSuccess() | bool | The method returns true if Greenrain MNC returned no errors. Otherwise, the method returns false. |
Class ValidationErrorsCollection
Class name: ValidationErrorsCollection
Namespace: Greenrain.Connect
Access modifier: Public
Description: This class contains a collection of validation errors.
Public members: refer to the table below.
Member Name | Data Type | Default Value | Description |
---|---|---|---|
ValidationErrors | IList<ValidationErrorMessage> | null | List of error messages. |
Public methods: refer to the table below.
Method Name | Return Data Type | Description |
---|---|---|
HasError() | bool | The method checks if the error collection contains at least one error. It returns true if Greenrain MNC has generated at least one error. Otherwise, the method returns false. |
HasWarning() | bool | The method checks if the error collection contains at least one warning. It returns true if Greenrain MNC has generated at least one warning. Otherwise, the method returns false. |
Class ValidationErrorMessage
Class name: ValidationErrorMessage
Namespace: Greenrain.Connect
Access modifier: Public
Description: This class contains error message details.
Public members: refer to the table below.
Member Name | Data Type | Default Value | Description |
---|---|---|---|
Title | string | null | Title of the error message. For example, it can be a transaction name that can be later shown in the errors report. |
FileName | string | null | E-claim transaction file name, if available. |
ErrorType | ErrorTypeEnum.None | Error type. | |
ErrorDescription | string | null | Error message. |
ValidationRuleId | string | null | Validation rule ID that has failed and returned an error. |
OwnerObjectName | string | null | E-claim object that generated the error, e.g. Activity, Claim, Observation, etc. |
OwnerObjectPropertyName | string | null | Name of the property in the owner object that caused the error. For example, if Activity.Net contains no value, then: OwnerObjectName = string 'Activity'. OwnerObjectPropertyName = string 'Net'. |
OwnerObjectPropertyValue | object | null | Value of the property in the owner object that caused the error. For example, if Activity.Start contains invalid date value '01/30/2012': OwnerObjectName = string 'Activity'. OwnerObjectPropertyName = string 'Start'. OwnerObjectPropertyValue = value '01/30/2012'. |
ReferenceObjectName | string | null | Reference object that is related to the error. It can be a parent object. Refer to an example below. |
ReferenceObjectPropertyName | string | null | Name of the property of the reference object. It can be a parent object. Refer to an example below. |
public object ReferenceObjectPropertyValue | object | null | Value of the reference properly. For example, there is an error with an invalid diagnosis code: ReferenceObjectName = string 'Claim'. ReferenceObjectPropertyName = string 'ID'. ReferenceObjectPropertyValue = Value of Claim.ID. |
AdditionalReference | string | null | Additional reference about the error, if available. |
Class GreenrainMnc
Class name: GreenrainMnc
Access modifier: Public
Description: This is the main class to run all available Medical Necessity Checks.
Performance consideration: The class uses Medical Necessity Checks edits that may consume a significant amount of memory (refer to Memory Consumption). Also, it might take a few seconds longer for the very first MNC check as the class loads all the edits to the memory during the first call. Therefore, it is important to consider the following to avoid a performance downgrade:
Create an instance of GreenrainMnc class only once when your application starts.
As one of the options, you might consider using singleton in your application.
Methods of the GreenrainMnc class may be called by different threads within the same process.
If you will create the instance of GreenrainMnc class just before you run the MNC check, this might slow down your application because it will load all the edits into the memory every time.
Example: if you get 1,000 claims to validate, you can use the following logic:
Create the instance of GreenrainMnc class when your app starts.
Create 10 threads to process 100 claims each.
Every thread can safely access the instance of GreenrainMnc class and validate their claims.
Public members: None.
Public methods: refer to the sections below.
Constructor
Access modifier: Public
Description: This is the class constructor.
Syntax
public GreenrainMnc(ILicenseManager licenseManager = null, IMncSettings mncSettings = null, IMncLoader mncLoader = null)
Parameters
Parameter | Data Type | Default Value | Description |
---|---|---|---|
licenseManager | ILicenseManager | null | LicenseManager class. If the parameter is null, the class will use license key found in the Settings. |
mncSettings | IMncSettings | null | If this parameter is null, then the constructor uses the current Greenrain MNC settings saved on the system. Otherwise, API uses the settings specified in the passed in MncSettings class. Therefore, the constructor can be called with any settings combination required by the caller, even if it is different from the current system settings. |
mncLoader | IMncLoader | null | Must be null all the time. This parameter is used for internal Greenrain MNC purposes. |
Return Value
None.
Exceptions
None.
RunMnc Method
Access modifier: Public
Description
The method is a single API that runs all crosswalks and edits supported by Greenrain MNC:
Run CPT and ICD10CM Crosswalk edits if:
Property mncSettings.CptAndIcd10cmCrosswalk = true, and
If the claim has at least one CPT code, and
The claim has at least one principal ICD-10-CM code or one secondary ICD-10-CM code.
Run NCCI edits if:
Property mncSettings.NcciEdits = true, and
The claim has at least two CPT codes.
Run edits for ICD-10-CM, Age, Gender, Incomplete Codes Crosswalk, Unacceptable Principal Diagnosis and Exclude 1 if:
Property mncSettings.Icd10cmAgeGenderAndIncompleteCodesCrosswalk = true.
The claim has at least one ICD-10-CM code
Age and gender-related edits are run only if patient age and patient gender are known respectively as it also checks the incomplete codes.
Run CPT, Age and Gender Crosswalk edit if:
Property mncSettings.CptAgeAndGenderCrosswalk = true, and
Patient age >= 0 or patient gender is male or female.
Run Maternity Checks edits if:
Property mncSettings.MaternityCheck = true, and
Patient gender = female.
Syntax
public ValidationResult GreenrainMnc.RunMnc(string claimId, PostOfficeEnum postOffice, int? encounterType, DateTime EncounterStart, int? patientAge, int? patientGender, IList<string> cptCodes, string principalDiagnosisCode, IList<string> secondaryDiagnosisCodes);
Parameters
Parameter | Data Type | Default Value | Description |
---|---|---|---|
claimId | string | null | Claim ID to be used as a reference. |
postOffice | PostOfficeEnum.Shafafiya | Type of Post Office to run MNC checks for. | |
encounterType | int? | null | Encounter type. Refer to Encounter Type for more details. |
EncounterStart | DateTime | DateTime.MinValue | Encounter start date. This parameter is required to identify the coding files version to be used for the MNC. |
patientAge | int? | null | Patient age. |
patientGender | int? | null | Patient gender that can accept the following values: null = Gender is unknown, this will raise an exception. 0 = Female. 1 = Male. |
cptCodes | IList<string> | null | List of CPT codes. |
principalDiagnosisCode | string | null | Principal ICD-10-CM codes. |
secondaryDiagnosisCodes | IList<string> | null | List of secondary ICD-10-CM codes. |
Return Value
The method returns a list of all found errors described in the section Alerts. A null value is returned if no alert is found.
Exceptions
Possible exceptions are described in Classes and API#Exceptions section.
RunClaimSubmissionChecks Method
Access modifier: Public
Description
The method performs the following logic:
Parse the passed in Claim.Submission XML transaction.
Calculate patient age using Emirates ID Number. The assumption is made that patient's birth date is January 1.
If Emirates ID Number has the default value, then the patient's age is set to unknown. In this case, all age-related checks are disabled.
Patient gender is not available in Claim.Submission transactions, therefore, gender-related checks are disabled.
Call Classes and API#RunMnc Method if any of the conditions is true:
The claim has at least one CPT code.
The claim has at least one principal ICD-10-CM code or one secondary ICD-10-CM code.
Only principal and secondary diagnoses are used for every claim. Other diagnosis types are ignored.
Syntax
public ValidationResult GreenrainMnc.RunClaimSubmissionChecks(PostOfficeEnum postOffice, byte[] xmlClaimSubmissionTransaction, string fileName);
Parameters
Parameter | Data Type | Default Value | Description |
---|---|---|---|
postOffice | PostOfficeEnum.Shafafiya | PostOfficeEnum.Shafafiya | |
xmlClaimSubmissionTransaction | byte[] | null | Content of XML file with Claim.Submission transaction. |
Return Value
If Encounter.Start in the Claim.Submission XML transaction has no value, then the default value of September 1, 2020, is used.
The method returns a list of all found errors described in the section Alerts. A null value is returned if no alert is found.
Exceptions
Possible exceptions are described in Classes and API#Exceptions section.
Exceptions
All API methods may raise exceptions described in the table below. The following rules are applied:
An exception is returned as ValidationResult class.
ValidationResult.Code = value of the exception code.
ValidationResult.Description = value of the error message.
ID | Error Message Example | Description |
---|---|---|
-1000 | An unexpected error occurred. | This exception is raised if anything goes wrong that we do not cover with exceptions in this table. |
-1001 | Greenrain MNC API requires a valid license. You can use Greenrain MNC Settings to enter the license key. | This exception may be raised in the following scenarios:
|
-1002 | Claim ID must have value. | This exception is raised when the Claim ID is empty. |
-1003 | At least one CPT code must be provided. | This exception is raised when no CPT is found. |
-1004 | At least one ICD-10-CM must be provided, either principal or secondary diagnosis. | This exception is raised when no ICD-10-CM is found. |
-1005 | Data Source is not found. | This exception is raised when Data Source does not exist or cannot be accessed for any reason. |
-1006 | At least two CPT codes must be provided. | This exception is raised when less than two CPT codes are found. |
-1007 | The patient's age is negative. | This exception is raised when the patient's age is a negative number. |
-1008 | Patient age is undefined or negative, and patient gender is not equal to 0 or 1. | This exception is raised when any of the below conditions is met:
|
-1009 | The content of the XML file may not be null. | This exception is raised when the XML file has no content. |
-1010 | The XML file must contain Claim.Submission xml transaction. | This exception is raised when the XML file does not contain Claim.Submission transaction. |
-1011 | The XML file must contain at least one claim. | This exception is raised when the XML file contains no claim. |
-1012 | Encounter Start may not be before January 1, 2008. | The encounter start date may not be before the first e-claims system started in the UAE. |
-1013 | Encounter start may not be in the future. | The encounter start date may not be the future date. |