uic-utah / uic-forms

7520 form filler outer
MIT License
0 stars 0 forks source link

Calculation for Field VI A for Class III wells on 7520-3 form is incorrect #22

Closed CanDKD closed 4 years ago

CanDKD commented 4 years ago

https://github.com/uic-utah/uic-forms/blob/3b612457d9d7d67e6f4bf2273f0e3701ec99bd9e/uic-forms/services/FieldMapper.cs#L80

My fault Steve, not yours!

Only wells that are counted in BOTH VI C AND VI D during a reporting period are included in the sum for field VI A

This can be covered under the new maintenance agreement that Nathan and Lenora are developing.

steveoh commented 4 years ago

This is the query for the Via_3b piece.

https://github.com/uic-utah/uic-forms/blob/3b612457d9d7d67e6f4bf2273f0e3701ec99bd9e/uic-forms/services/Querier.cs#L590-L617

I don't know how to take what you are telling me and translate it into a SQL query.

There are a lot of vi c and vi d queries so I'm not sure what wells you want counted.

https://github.com/uic-utah/uic-forms/blob/3b612457d9d7d67e6f4bf2273f0e3701ec99bd9e/uic-forms/services/FieldMapper.cs#L83-L99

rsparker-utah commented 4 years ago

Hi Steve, After speaking with Candace, this is what should be queried for {"Via_3b", "WellsMIT"}: A well only gets counted in a reporting period for field {"Via_3b", "WellsMIT"} (i.e., row 80) if it is reported in both:

{"Vic1p_3b",   "APEval_Pass"},
{"Vic1f_3b",   "APEval_Fail"},
{"Vic2p_3b",   "CasingPressure_Pass"},
{"Vic2f_3b",   "CasingPressure_Fail"},
{"Vic3p_3b",   "MonitorEval_Pass"},
{"Vic3f_3b",   "MonitorEval_Fail"},
{"Vic4p_3b",   "OtherLeakEval_Pass"},
{"Vic4f_3b",   "OtherLeakEval_Fail"},

And

{"Vid1p_3b",   "CementEval_Pass"},
{"Vid1f_3b",   "CementEval_Fail"},
{"Vid2p_3b",   "TempTest_Pass"},
{"Vid2f_3b",   "TempTest_Fail"},
{"Vid3p_3b",   "RadTest_Pass"},
{"Vid3f_3b",   "RadTest_Fail"},
{"Vid4p_3b",   "OtherFluidTest_Pass"},
{"Vid4f_3b",   "OtherFluidTest_Fail"},
steveoh commented 4 years ago

Ok, here is my recap...

Problem

via_3b needs to be a conditional summation of wells in both groups not the "normal" summation we are currently using

Solution

  1. query mech integrities for all vic's and capture well guid

    {"Vic1p_3b",   "APEval_Pass"},
    {"Vic1f_3b",   "APEval_Fail"},
    {"Vic2p_3b",   "CasingPressure_Pass"},
    {"Vic2f_3b",   "CasingPressure_Fail"},
    {"Vic3p_3b",   "MonitorEval_Pass"},
    {"Vic3f_3b",   "MonitorEval_Fail"},
    {"Vic4p_3b",   "OtherLeakEval_Pass"},
    {"Vic4f_3b",   "OtherLeakEval_Fail"}
  2. query mech integrities for all vid'd and capture well guid

    {"Vid1p_3b",   "CementEval_Pass"},
    {"Vid1f_3b",   "CementEval_Fail"},
    {"Vid2p_3b",   "TempTest_Pass"},
    {"Vid2f_3b",   "TempTest_Fail"},
    {"Vid3p_3b",   "RadTest_Pass"},
    {"Vid3f_3b",   "RadTest_Fail"},
    {"Vid4p_3b",   "OtherFluidTest_Pass"},
    {"Vid4f_3b",   "OtherFluidTest_Fail"}
  3. set via_3b to the intersection of those two sets of guids

a narrative is required

Time estimate

8-12 hours

rsparker-utah commented 4 years ago

Hi Steve,

A little over a week ago I was able to meet with Candace and we were able to set up some data in the development instance of the UIC gdb in preparation for testing the proposed correction for UIC form field {"Via_3b", "WellsMIT"}.

We created a new test facility called via_3b and then created two wells within this facility: via_3b Well #1 and via_3b Well#2.

Well #1 contains only 1 mechanical integrity test i.e., 1-Casing/Tubing Pressure Test.

Well#2 contains 2 mechanical integrity tests i.e., 1-Annulus Pressure Monitoring Record Eval and 2-Cement Bond Testing.

This facility and both of the wells have a creation date of 3/6/2020.

Our intent is that when a query is run on this data, Well#2 above will be the only summation added to field {"Via_3b", "WellsMIT"}.

Hopefully this is enough information to be able to test changes to the form query, but please let me know if you need any additional information. Thank you!

rsparker-utah commented 4 years ago

Hi Steve,

I was able to add additional facilities and wells to the development instance of the UIC gdb to increase the sample count. With the addition of this newly added test data there are a total of: 3 facilities and 6 wells (2 wells per facility). I have included a table (i.e., “UIC gdb Development Instance MIT Test Data”) summarizing the data I entered. This table shows the test data entered for the facilities, accompanying wells, mechanical integrity tests per well and anticipated query result per well.

image

With this test data I would expect the modified query for {"Via_3b", "WellsMIT"} to count the following 3 wells given that each of these wells have mech integrities from vic and vid: via_3b Well#2, Github#22 Well 2, Github#22 Well 3. Please let me know if you need any additional information and/or additional test data added.

steveoh commented 4 years ago

I'm going to add waiting back to this since we need a some clarification from Candace and some of the test data has some possible inconsistencies.

Also please let me know what the reporting period dates are for this test data.

rsparker-utah commented 4 years ago

Hi Steve, Ok that sounds good. I’ll keep you posted when I get further clarification. As an update, I adjusted all the test data wells to make sure they are all class 3 wells. I also ran the reconcile and post scripts on the development instance of the UIC gdb, so these changes should be available. To answer your question regarding reporting period dates, the dates for all of the wells and MITs for this test data are in March, so according to the UIC documentation I have that should align with FFY Quarter 2 (Oct 1 to March 31).

rsparker-utah commented 4 years ago

Hi Steve,

Candace was very generous and looked over the questions that I sent her. The questions I asked and her responses are as follows (answers are italicized):

Question 1: The title for the Github issue#22 is "Calculation for Field VI A for Class III wells on 7520-3 form is incorrect#22" and he wanted to confirm that this issue only pertains to class 3 wells. Is that correct that this only pertains to class 3 wells?

This pertains to all wells but we don't have any Class I wells in Utah, yet; Class IV wells would almost never have MITs; Class V wells could potentially have MITs but not while I was administering the program.

Question 2: Should the values be unique across the well classes?

If I understand his question correctly, yes, this would be a unique calculation for each well class. If you look at the pdf of the original 7520-3 form, you will see that there is a VI A field for each well class, so that field for Class 3 wells will be something like via-3. I don't have a copy of the original 7520-3 form but if you can send it to me I'll circle the fields I am talking about.

I have attached the 7520-3 form she referenced in her answer for Question 2 in case that helps. I hope that helps, but let me know if you need additional information. Candace also mentioned she would be willing to have a video conference if it would be helpful. If you think this would be beneficial let me know and I'll be happy to set it up. 7520-3.docx

Thanks

steveoh commented 4 years ago

OK, so this value is then calculated for the via_{wellclass}b field... not just the via_3b field.

The same must apply for the VIC's and VID's to count the intersection. The numbers need to match the well class...

This is only for class 3 wells. vid1p_5b would be used for class 5 wells etc.

{"Vid1p_3b",   "CementEval_Pass"},
{"Vid1f_3b",   "CementEval_Fail"},
{"Vid2p_3b",   "TempTest_Pass"},
{"Vid2f_3b",   "TempTest_Fail"},
{"Vid3p_3b",   "RadTest_Pass"},
{"Vid3f_3b",   "RadTest_Fail"},
{"Vid4p_3b",   "OtherFluidTest_Pass"},
{"Vid4f_3b",   "OtherFluidTest_Fail"}

I'm not sure that makes sense since only via_3b deals with MIT wells. via_2b is wells with enforcements... I have confused myself. the 3 in via_3b probably does not denote the well class right?

steveoh commented 4 years ago

Whatever I am doing it not right because I am getting 0 for all the well classes.