multiple multiple-quadrant procedures

This forum is for programmers who have questions about the source code.
Post Reply
alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

multiple multiple-quadrant procedures

Post by alkhaef » Fri Jul 02, 2010 7:44 pm

Sorry for the tongue-twister title ;)

Right now, the automated-quadrant code is limited to one such procedure. If you want a two four-quad procedures, it begins duplicating UR on the second procedure.

The following simple patch against the current head should* change this behavior to allow multiple procedures by starting over after the last quad.

I say should*, because I haven't tested it yet (my toolchain isn't setup yet). This post is mainly here so I can get all the community etiquette straight first, since I couldn't find a contribution guidelines document or something similar (e.g. patch format - i used "diff -up"... where patches should be placed... etc).

Code: Select all

--- ContrChart.cs.original      2010-07-02 19:47:15.997000000 -0700
+++ ContrChart.cs       2010-07-02 19:52:12.950125000 -0700
@@ -4995,14 +4995,13 @@ namespace OpenDental{
                                        continue;//only entered if n=0, so they don't get entered more than once.
                                }
                                else if(tArea==TreatmentArea.Quad){
-                               //      switch(quadCount){
+                               //      switch(quadCount++){
                                //              case 0: Procedures.Cur.Surf="UR"; break;
                                //              case 1: Procedures.Cur.Surf="UL"; break;
                                //              case 2: Procedures.Cur.Surf="LL"; break;
                                //              case 3: Procedures.Cur.Surf="LR"; break;
-                               //              default: Procedures.Cur.Surf="UR"; break;//this could happen.
+                               //              default: Procedures.Cur.Surf="UR"; quadCount=1; break;//this could happen.
                                //      }
-                               //      quadCount++;
                                //      AddQuick();
                                        //Procedures.Cur=ProcCur;
                                        AddProcedure(ProcCur);
@@ -5229,14 +5228,13 @@ namespace OpenDental{
                                                continue;//only entered if n=0, so they don't get entered more than once.
                                        }
                                        else if(tArea==TreatmentArea.Quad){
-                                               switch(quadCount){
+                                               switch(quadCount++){
                                                        case 0: ProcCur.Surf="UR"; break;
                                                        case 1: ProcCur.Surf="UL"; break;
                                                        case 2: ProcCur.Surf="LL"; break;
                                                        case 3: ProcCur.Surf="LR"; break;
-                                                       default: ProcCur.Surf="UR"; break;//this could happen.
+                                                       default: ProcCur.Surf="UR"; quadCount=1; break;//this could happen.
                                                }
-                                               quadCount++;
                                                AddQuick(ProcCur);
                                        }
                                        else if(tArea==TreatmentArea.Surf){
@@ -5326,14 +5324,13 @@ namespace OpenDental{
                                                continue;//only entered if n=0, so they don't get entered more than once.
                                        }
                                        else if(tArea==TreatmentArea.Quad){
-                                               switch(quadCount){
+                                               switch(quadCount++){
                                                        case 0: ProcCur.Surf="UR"; break;
                                                        case 1: ProcCur.Surf="UL"; break;
                                                        case 2: ProcCur.Surf="LL"; break;
                                                        case 3: ProcCur.Surf="LR"; break;
-                                                       default: ProcCur.Surf="UR"; break;//this could happen.
+                                                       default: ProcCur.Surf="UR"; quadCount=1; break;//this could happen.
                                                }
-                                               quadCount++;
                                                AddQuick(ProcCur);
                                        }
                                        else if(tArea==TreatmentArea.Surf){
@@ -5467,14 +5464,13 @@ namespace OpenDental{
                                        continue;//only entered if n=0, so they don't get entered more than once.
                                }
                                else if(tArea==TreatmentArea.Quad) {
-                                       switch(quadCount) {
+                                       switch(quadCount++) {
                                                case 0: ProcCur.Surf="UR"; break;
                                                case 1: ProcCur.Surf="UL"; break;
                                                case 2: ProcCur.Surf="LL"; break;
                                                case 3: ProcCur.Surf="LR"; break;
-                                                default: ProcCur.Surf="UR"; break;//this could happen.
+                                                default: ProcCur.Surf="UR"; quadCount=1; break;//this could happen.
                                        }
-                                       quadCount++;
                                        AddQuick(ProcCur);
                                }
                                else if(tArea==TreatmentArea.Surf) {


It's not the cleanest approach (for example, it might be better to have a quadCount array instead, one-per-procedure, so that procedure orders don't matter), but again, this is my first OD patch request, so I wanted to propose something simple that stays very close to the current code.
Last edited by alkhaef on Fri Jul 09, 2010 2:44 pm, edited 1 time in total.
Al
Help! I've OD'ed on OD! :)

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: multiple multiple-quadrant procedures

Post by alkhaef » Fri Jul 02, 2010 8:19 pm

Guess this is why it's a bad idea to submit premature patches :-S... Looks like all the quadCount=0; statements should actually be quadCount=1;

Thanks,
Al
Al
Help! I've OD'ed on OD! :)

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: multiple multiple-quadrant procedures

Post by jordansparks » Fri Jul 02, 2010 9:13 pm

The reason there's no contribution guidelines is because we don't generally accept contributions. It has been a source of clutter, instability, bugs, inconsistent style, etc. Because a stable code base is so important, and due to lack of time, we stopped accepting patches. For this particular suggestion, for example, I would have to take the time to test it.
Jordan Sparks, DMD
http://www.opendental.com

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: multiple multiple-quadrant procedures

Post by alkhaef » Thu Jul 08, 2010 11:02 am

Hello Doctor Sparks.

Thanks for the reply. In fact, what you've mentioned is exactly what I'm referring to when I say "contribution guidelines" - a huge part of this is the boundaries of community member individuals.
I'd like to stay within those boundaries, so before I decide on a methodology for how our office should use OpenDental, I want to make sure I'm understanding everything correctly.

Here's a reduced flowchart of a typical bug's life - Items marked as B are welcome as internal OR community contributions, and items marked as A are only to be done internally by the OpenDental development team...
1. Bug reported - B
2. Bug confirmed, verified as non-duplicate, etc., and entered into tracking system - A <-- Note: Not welcome as a community contribution, based on "internal use" comment at developers.html (although "new bug" link exists?)
3. Solution proposed in the form of a patch - A <-- Note: Not welcome as a community contribution, based on Dr. Sparks's reply on this thread
4. Solution tested for correctness, coding style, etc. - A
5. Loop back to 3 until 4 passes - A
6. Final solution committed - obviously A
7. Solution tested by community - B
Based on the above, the only feedback accepted from us is the actual reporting and testing of a bug.

Could you please let me know if the above is correct?
Also, with the above in mind, do you guys welcome suggestions or hints to relevant sections of code with step 2?

Thanks again,
Al
Al
Help! I've OD'ed on OD! :)

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: multiple multiple-quadrant procedures

Post by jordansparks » Thu Jul 08, 2010 12:12 pm

1. But not from just anyone. Usually only if person submitting is on customer support because it takes time to verify that it's a bug.
3. Sort of. A patch for a known bug that's already on the list is always welcome. My previous response was more about enhancements. Your patch was an enhancement rather than a bug fix.
Jordan Sparks, DMD
http://www.opendental.com

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: multiple multiple-quadrant procedures

Post by alkhaef » Fri Jul 09, 2010 2:39 pm

Dr. Sparks,

Thanks for the clarifications!

I strayed off-topic from the original post a bit, so I'm sorry for that... I'll try to start a new thread later for the methodology-related stuff after putting some visuals together based on your feedback.

Regarding the original post, I posted it seeing it as a bug fix, because automated-quadrants is already an existing feature - it just fails to work "as expected" when you have more than one procedure (based on my subjective definition of "expected", I guess...). In our case, we've already had a few claims we've had to resubmit because the quadrants weren't updated by us and the claim was sent with a procedure duplicated on the same quadrant (there are probably several we haven't caught too...).

Nevertheless, I'll post a feature request, since that appears to be your diagnosis of this request.

In the meantime, could I request a _start / _begin hook in ContrChart.AddQuick so that I can at least patch up duplicated quadrants in my local plugin?

Best regards,
Al

EDIT: Forgot to mention - For the hook to be helpful in this case, I'd need ProcCur passed as a reference.
Al
Help! I've OD'ed on OD! :)

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: multiple multiple-quadrant procedures

Post by jordansparks » Thu Jul 15, 2010 8:24 pm

Done.
Jordan Sparks, DMD
http://www.opendental.com

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: multiple multiple-quadrant procedures

Post by alkhaef » Mon Jul 19, 2010 7:31 pm

Thanks Dr. Sparks.

Sorry if I was unclear, but I meant for the request to be a HookAddCode-type hook with a _start suffix at that same location, not a HookMethod-type.

Thanks again,
Al
Al
Help! I've OD'ed on OD! :)

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: multiple multiple-quadrant procedures

Post by jordansparks » Tue Jul 20, 2010 12:15 pm

Done.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply