Project Hospital
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
PanzerKadaver
PanzerKadaver
intern
Posts : 8
Reputation : 0
Join date : 2019-08-31

[Mod] Examinations Fees Empty [Mod] Examinations Fees

Sat Aug 31, 2019 7:57 pm
Hospital Managers,

As requested, our billing software is now compatible with individual examinations fees. As you already know, Health Insurances will only accept fees if, and only if, viable symptoms have been discovered with the subsequent examination.

Regards,
General Hospital Council

A little and dirty mod made in two day (and a full week to get the motivation to write this post). With a small dll edit (see tutorial below) and a game addon, patients will now get billed when they complete a examination (only if the examination manage to unveil symptoms). As usual, patient will pay their bill when they leave the hospital IF THEY ARE TREATED.

Mod Version : 1.0
Game Version : 1.1.X
Mod File : Google Drive

Dll Edit Tutorial :


  1. Get dnSpy
  2. Add the game dll to the tool (steamapps\common\Project Hospital\ProjectHospital_Data\Managed) : Assembly-CSharp.dll [File > Open]
  3. Unroll "Lopital" sub-tree
  4. Search "BehaviorPatientStateData" in the class list, right-click, and hit "Edit Class (C#)"
  5. Add the following code at the end of the class :
    Code:
    public int m_exams_fee;

  6. Hit "Compile"
  7. Hit Ctrl+Shift+S and hit "OK"
  8. Search "BehaviorPatient" in the class list, right-click, and hit "Edit Class (C#)"
  9. In the class edit, search (Ctrl+F) the method named "GetInsurancePayment"
  10. Erase it and replace with the following code :
    Code:

    public int GetInsurancePayment(bool checkDiagnosis)
    {
     this.m_state.m_exams_fee = this.GetExamsFee();
     if (this.m_state.m_medicalCondition.m_diagnosedMedicalCondition == null)
     {
     if (checkDiagnosis)
     {
     this.m_entity.LogWarning("Paying for a patient without diagnosis?");
     }
     return this.m_state.m_exams_fee;
     }
     float num = (float)(this.m_state.m_medicalCondition.m_diagnosedMedicalCondition.Entry.InsurancePayment + this.m_state.m_exams_fee);
     int prestigeInsurancePaymentModifierLastDay = Hospital.Instance.GetPrestigeInsurancePaymentModifierLastDay();
     float num2 = (float)(100 + prestigeInsurancePaymentModifierLastDay + base.GetComponent<CharacterPersonalInfoComponent>().m_personalInfo.m_insuranceCompany.Entry.CoverCostPercent);
     return (int)(num * num2 / 100f);
    }

    public int GetExamsFee()
    {
     int num = 0;
     foreach (ExaminationState examinationState in base.GetComponent<ProcedureComponent>().m_state.m_procedureQueue.m_finishedExaminations)
     {
     if (examinationState.m_discoveredSymptoms > 0)
     {
     num += examinationState.m_examination.Entry.Cost;
     }
     }
     return num;
    }

  11. Hit "Compile"
  12. Hit Ctrl+Shift+S and hit "OK"
  13. You're done !


If you wish to edit exam fees, the value to edit in the addon xml file is
Code:
<Cost>XXX</Cost>

Enjoy !
jan.oxymoron
jan.oxymoron
developer
Posts : 2240
Reputation : 325
Join date : 2018-03-23

[Mod] Examinations Fees Empty Re: [Mod] Examinations Fees

Mon Sep 02, 2019 5:43 pm
Message reputation : 100% (1 vote)
Hi, thanks for sharing! Smile

A bit of context - we originally planned to do something similar (hence the costs still left in the xmls), but ended up with the current system, where you get paid according to the final diagnosis. The main reasons were that getting paid for diagnosis encourages being efficient with the examinations and doesn't allow easy cheating by ordering a lot of expensive examinations (or treatments) that the patient will have to pay for - but the mod solves this by only counting the examinations that actually discovered some symptoms.
PanzerKadaver
PanzerKadaver
intern
Posts : 8
Reputation : 0
Join date : 2019-08-31

[Mod] Examinations Fees Empty Re: [Mod] Examinations Fees

Mon Sep 02, 2019 5:52 pm
jan.oxymoron wrote:Hi, thanks for sharing! Smile

A bit of context - we originally planned to do something similar (hence the costs still left in the xmls), but ended up with the current system, where you get paid according to the final diagnosis. The main reasons were that getting paid for diagnosis encourages being efficient with the examinations and doesn't allow easy cheating by ordering a lot of expensive examinations (or treatments) that the patient will have to pay for - but the mod solves this by only counting the examinations that actually discovered some symptoms.

Hi Jan !

No, thank you for the game ! It's give me the perfect "Dr House" vibes and manage an hospital work well with a MD Tv Serie on the other screen Laughing

Hélas, it look like my mod unveil a strange bug  Crying or Very sad

After some times (1H in-game I guess), all "Paid" examination seems to be unable to reveal any symptoms, despite they are completed successfully. I've try to move my code in another place, make shallow copy of m_finishedExaminations but the bug still occurs.

I'll try to decompile the dll and add some break points to "diagnose" this problem.
Sponsored content

[Mod] Examinations Fees Empty Re: [Mod] Examinations Fees

Back to top
Permissions in this forum:
You cannot reply to topics in this forum