API browser of generalInvoiceRequest500 COM module


/images/arrow_right.png IGeneralInvoiceRequest::AddService method space
Adds a service from a simple/normal tariff to the list of services.
The term "normal" means a tariff with a simple (code, name, tax point) structure as opposed to "extended" tariffs whose services are splitted into a medical and technical part (like Tarmed or Tardoc).
 
Auto-expansion: under the condition that the corresponding validator is installed and eIgnoreValidate=enNo then bstrText, dUnit, and dAmount are auto-expanded to the correct values by the validator if and only if these values are set empty or 0, respectively.
 
Important new feature: the AddService method has been patched to allow for controlling the underlying validators by using a pseudo service code: bstrCode="setParameter(cmd=value)", where cmd=value are validator specific commands. In such a case besides the service code (bstrCode) only the tariff type (bstrTariffType) and date (dDate) must be defined.
 
Currently there are defined pseudo codes for the following tariff types/validators in effect: Pseudo codes are active until the next call of the Initialize method and are then reset to their default values.
Do not use pseudo service codes if the validator is turned off by setting eIgnoreValidate=enYes!
 
If the return status is VARIANT_FALSE then the service record is not added or the pseudo service code was not accepted!
space
/images/arrow_right.png Restful webservice calling syntax
[POST] /baseURL/IGeneralInvoiceRequest/AddService
[JSON input data] pIGeneralInvoiceRequest:
bstrTariffType:
bstrCode:
bstrReferenceCode:
dQuantity:
lSessionNumber:
lGroupSize:
dDateBegin:
dDateEnd:
bstrProviderGLN:
bstrResponsibleGLN:
eSide:
bstrServiceName:
dUnit:
dUnitFactor:
dExternalFactor:
dAmount:
dVatRate:
bstrRemark:
bstrSectionCode:
eIgnoreValidate:
lServiceAttributes:
longValue,    //interface address
"utf8StringValue",
"utf8StringValue",
"utf8StringValue",
doubleValue,
longValue,
longValue,
variantDateValue | "stringISODateValue",
variantDateValue | "stringISODateValue",
"utf8StringValue",
"utf8StringValue",
longValue,
"utf8StringValue",
doubleValue,
doubleValue,
doubleValue,
doubleValue,
doubleValue,
"utf8StringValue",
"utf8StringValue",
longValue,
longValue
[JSON result data] plID:
pbStatus:
longValue,
booleanValue
 
[HTTP result status] 200 Return status 200 signals a successful method call
204 Return status 204 (noContent) signals that the end of an iteration is reached
>= 400 Return status >= 400 signals an unsuccessful function call. The returned JSON{errorCode: code, errorText:"text"} supplies the error message the same as GetAbortInfo() would do.
space
/images/arrow_right.png C/C++ calling syntax
HRESULT AddService( BSTR
BSTR
BSTR
double
long
long
DATE
DATE
BSTR
BSTR
SideType
BSTR
double
double
double
double
double
BSTR
BSTR
YesNoType
long
long
VARIANT_BOOL
bstrTariffType,
bstrCode,
bstrReferenceCode,
dQuantity,
lSessionNumber,
lGroupSize,
dDateBegin,
dDateEnd,
bstrProviderGLN,
bstrResponsibleGLN,
eSide,
bstrServiceName,
dUnit,
dUnitFactor,
dExternalFactor,
dAmount,
dVatRate,
bstrRemark,
bstrSectionCode,
eIgnoreValidate,
lServiceAttributes,
*plID,
*pbStatus);
[C/C++ return value] S_OK This value is returned if the function call was successful.
S_FALSE This value is returned if the end of an iteration is reached
E_name This value is returned if the function call was unsuccessful and an error exception was generated. Note that if you are using SmartPointers an exception is thrown under these conditions.
space
/images/arrow_right.png Calling argument description
[in] BSTR bstrTariffType The official tariff type as defined by Forum Datenaustausch
[in] BSTR bstrCode The service code.
 
Important new feature: in order to control the underlying validators the feature of pseudo service codes bstrCode="setParameter(cmd=value)" have been defined, where cmd=value are validator specific.
[in] BSTR bstrReferenceCode The reference code if one must be supplied.
 
Supply an empty string if there is no reference code to set.
[in] double dQuantity The floating point quantity.
 
Note that quantity changes the sign if a storno request is produced.
[in] long lSessionNumber lSessionNumber defines either a specific patient contact with an unique number over the entire treatment period or
a day-based session number. The session number divides the day into a series of individual treatment units (sessions), whereby by default
each day starts with the number 1 and is incremented by 1 for each new treatment unit.
&nbp;
Some tariffs do not include a session concept, others such as TARMED/TARDOC rely heavily on this paradigm.
For tariffs without a session concept, simply enter 1 as the session number for all services on one day.
[in] long lGroupSize lGroupSize defines the size of a participating group of a service whose quantity is calculated by the "Divisor Method".
It should be noted that the group size is declarative only with a default value equals to 1 implicitly meaning that it is NO service defined via the "Divisor Method" as the group size for such a service is always larger than 1.
 
Please note that in the "Divisor Method" the quantity is coded by definition as follows: quantity = effective_quantity / group_size.
[in] DATE dDateBegin The date of the service's prescription
[in] DATE dDateEnd The date of the last prescription of the service if and only if the service was applied over a period of time.
 
dDateEnd is ignored if the condition (dDateEnd > dDateBegin+1) is not true! Therefore dDateEnd=0 is supplied for the vast majority of services.
[in] BSTR bstrProviderGLN The GLN of the service provider as supplied by Stiftung Refdata
 
Note if bstrProviderGLN is undefined and bstrResponsibleGLN is defined then bstrResponsibleGLN is copied into the bstrProviderGLN variable. If both variables are undefined the pseudo GLN "2099999999998" is set.
[in] BSTR bstrResponsibleGLN The GLN of the responsible for the service as supplied by Stiftung Refdata
 
Note if bstrResponsibleGLN is undefined and bstrProviderGLN is defined then bstrProviderGLN is copied into the bstrResponsibleGLN variable. If both variables are undefined the pseudo EAN "2099999999998" is set.
[in] SideType eSide The body side dependency of the service
[in] BSTR bstrServiceName The name of the service as defined by the used tariff
[in] double dUnit Tax points (TP) of the service.
[in] double dUnitFactor Tax point value (TPV) of the service.
[in] double dExternalFactor dExternalFactor is an external scaling factor in the provider's responsibility that modulates the corresponding service outside the official tariff structure.
The dExternalFactor is used for discounting or surcharging and can even take a zero value to supply a charge free service.
 
For tariff «005 - AmbulatoryCaseFlatrate» the tariff owner "OAAT-OTMA" will use the
dExternalFactor as an additional control element within its cost neutrality project. It is currently unclear how, where and when the
corresponding data will be made available. It is also unclear whether this is a date-historical usage of the factor.
 
For tariff «010 - DRG» the external factor is used for defining the splitting situation between insurance and canton.
[in] double dAmount The amount in CHF for the service.
 
Note that amount changes the sign if a storno request is produced due to the sign change of dQuantity.
[in] double dVatRate The VAT rate as real number that should be applied to this service e.g. 0.081 for a VAT rate of 8.1%.
[in] BSTR bstrRemark An optional remark for the given service
 
Patch for populating service attributes
If service attribute keywords
{Code207 | Franchisefree_12e_d}
are supplied (case-independent) as part of the remark, than these keywords are migrated into the lServiceAttributes variable and thereafter removed from the remark.
Thus, this is an alternative method of setting lServiceAttributes - cf. below.
[in] BSTR bstrSectionCode The optional bstrSectionCode stems from a variable set defined by "OAAT-OTMA - Reglement Fachbereiche", that designates the service-providing department within a hospital or medical practice, e.g. 'M100.06' for the gastroenterology department.
 
The list of all departments is documented elsewhere on the "OAAT-OTMA" website, whereby the tariffs used, the law applied or special contracts stipulates the application/usage of the section code (primarily for body@role=hospital, body@role=rehab_clinic, body@role=psychiatric_clinic).
[in] YesNoType eIgnoreValidate Flag indicating whether the validation must be ignored that is whether the corresponding validator must be called or not.
 
This flag might be useful in the following situation: the user wants to add the service even if the validation failed, perhaps he has a special agreement with the insurance or patient.
[in] long lServiceAttributes lServiceAttributes is a 32-bit integer where each bit position defines a special information.
 
Defined bit positions as of November 2024
Bit Meaning
Bit 1:
(0x000001)
Code207: no drug substitution due to medical reasons. Applies to drug services only!
 
If this bit ("Code207") is set, the service provider declares that the drug prescribed must not be substituted due to medical reasons.
 
In a printed invoice/reminder, bit 1 is written as SA='Code207' in the comment line, case insensitive.
If more than one service attribute is set, all defined mnemonics are combined as SA='BitX+BitY+BitZ'.
Bit 2:
(0x000002)
franchiseFree: Franchise exemption of given service
 
If this bit ("franchiseFree") is set, the service provider declares that the service was provided as franchise free.
 
In a printed invoice/reminder, bit 2 is written as SA='franchiseFree' in the comment line, case insensitive.
If more than one service attribute is set, all defined mnemonics are combined as SA='BitX+BitY+BitZ'.
Bit 3:
(0x000004)
drugOffLabelUse: off label use of a drug in accordance with Art. 71a-c KVV
 
If this bit ("drugOffLabelUse") is set, the service provider declares that the off-label prescription of the drug has been approved by the healthcare insurance by means of a prior accepted credit request.
 
In a printed invoice/reminder, bit 3 is written as SA='drugOffLabelUse' in the comment line, case insensitive.
If more than one service attribute is set, all defined mnemonics are combined as SA='BitX+BitY+BitZ'.
Bit 4:
(0x000008)
withoutDoctorsOrder: Services without a doctor's order (Art. 59 KVV, Abs. 3bis)
 
If this bit ("withoutDoctorsOrder") is set, the service provider declares that the service was provided without a doctor's order.
 
In a printed invoice/reminder, bit 4 is written as SA='withoutDoctorsOrder' in the comment line, case insensitive.
If more than one service attribute is set, all defined mnemonics are combined as SA='BitX+BitY+BitZ'.
Bit 5:
(0x000010)
noObligation: the applied service is not an obligatory insurance benefit under the given Law (or Contract)
 
If this bit ("noObligation") is set, the service provider declares that the service provided is not an obligatory insurance benefit under the given law (or contract).
 
In a printed invoice/reminder, bit 5 is written as SA='noObligation' in the comment line, case insensitive.
If more than one service attribute is set, all defined mnemonics are combined as SA='BitX+BitY+BitZ'.
[out] long *plID This is the returned internal ID of the service record.
 
This internal ID is used to append extraService, extraDrug and/or xtraDRG information for the focused service with the SetXtraService, SetXtraDrug or SetXtraDRG methods, respectively.
[out,retval] VARIANT_BOOL *pbStatus Return status of the method. If pbStatus is VARIANT_FALSE then an error occurred and GetAbortInfo should be called to retrieve the error string.
space