ROC¶
- ROC implementation is reusing data model from pec anf facturation services.
- It can be seen as an extension of the facturation service that was only working when an existing PEC was already submitted.
- For ROC, the valoriser operation created the facturation and the associated pec and valorise it.
The ROC webservice has 3 operations: - valoriser: create a ROC request and valorise it. - acquitter: Almerys acknowledge the response. - annuler: Almerys cancel a ROC request.
Valoriser¶
They can either simulate a valorisation (SIM) or compute a real one (CLC). - SIM: Is used by hospitals to simulate the valorisation of a hospital stay. They generate do different SIM requests during the hospital stay to evaluate the reimbursements. - CLC: At the end of the stay, the hospital send a CLC request to get the final valorisation. This is equivalent to a PEC request but with more information.
CLC case¶
sequenceDiagram
participant Alm as Almerys
participant ROC as ROC SOAP Service
participant TPFacturation as TP Facturation logic
participant TPPEC as TP PEC logic
participant helpers as Helpers
participant CE as Claim Engine
Alm->>ROC: valoriser
ROC->>+TPFacturation: TPFacturationRequest.get
TPFacturation-->>-ROC: TPFacturationRequest | null ?
alt non existing facturation
ROC->>+TPPEC: TPPecRequest.get_or_create
TPPEC-->>-ROC: TPPecRequest
ROC->>+TPFacturation: TPFacturationRequest.create
TPFacturation-->>-ROC: TPFacturationRequest
ROC->>+TPFacturation: TPFacturationResponse.get_or_create
TPFacturation->>+helpers: add_response_prestations
helpers->>+CE: compute reimbursement from generated quote
CE-->>-helpers: computed reimbursement
helpers-->>-TPFacturation: TpFacturationResponsePrestations
TPFacturation-->>-ROC: TPFacturationResponse
ROC->>+TPPEC: build PEC responses and prestations from facturation
TPPEC-->>-ROC: TPPecResponse
alt TPFacturationResponse has a global rejection code
ROC-->>Alm: RefusReponse
else
ROC-->>Alm: ValorisationResponse
end
else existing facturation
ROC-->>Alm: RefusReponse (pec_already_invoiced)
end
SIM case¶
SIM are similar to CLC but they don't create a PEC. They are used to simulate the valorisation of a hospital stay. We only rely on TP Facturation data model.
[!NOTE] An hospital can generate multiple SIM requests during the hospital stay to evaluate the reimbursements with the exact same id (almerys id, creation date, insurance profile). We create a new facturation each time we receive a SIM request.
sequenceDiagram
participant Alm as Almerys
participant ROC as ROC SOAP Service
participant TPFacturation as TP Facturation logic
participant helpers as Helpers
participant CE as Claim Engine
Alm->>ROC: valoriser
ROC->>+TPFacturation: TPFacturationRequest.create
TPFacturation-->>-ROC: TPFacturationRequest
ROC->>+TPFacturation: TPFacturationResponse.get_or_create
TPFacturation->>+helpers: add_response_prestations
helpers->>+CE: compute reimbursement from generated quote
CE-->>-helpers: computed reimbursement
helpers-->>-TPFacturation: TpFacturationResponsePrestations
TPFacturation-->>-ROC: TPFacturationResponse
alt TPFacturationResponse has a global rejection code
ROC-->>Alm: RefusReponse
else
ROC-->>Alm: ValorisationResponse
end
ROC-->>Alm: ValorisationResponse
FAQ¶
Why do we use TP Pec and TP Facturation data model instead of a new one?¶
- From Almerys perspective, ROC is an extension of the facturation webservice, and it was easier to extend it.
- Instead of first creating a PEC and then a facturation, we create both from the same ROC service.
- It's also easier to reuse the TP Pec objects to generate the valorisation response as they are wildly used in the code base. For instance to :
- compute insurance profile usage
- mark a prestation as paid when we receive a TP decompte
- compute IPIC freshness