question

Cinar Tuncel avatar image
1 Like"
Cinar Tuncel asked Matthew Gillespie commented

Error 13161: Invalid PCI was Found

I'm trying to use Appointments function with a distribution however getting an error message saying certain PCIs are missing. However, I can find those PCIs in the PCI table when I manually check.

Any idea why this might be happening?

[Update] This error message appears when there are multiple PCIs have the same appointment time. Their actual arrival is different as a result of the added variation to the appointments.

FlexSim HC 5.0.12
error messageappointmentspci
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Your distributions could be generating numbers outside the range of PCI's in the table.

I feel like I don't have enough information to help you out. Would it be possible for you to post your model? That would be the quickest way for us to get you an answer. If you don't want your model to be public we still have a couple options:

  1. Re-post this question as a private question. This way only FlexSim employees can see the question.
  2. You could strip out most of your model so that only the arrival objects and PCI table remain (or whatever is necessary to show the error) and then post that model.
0 Likes 0 ·
Cinar Tuncel avatar image Cinar Tuncel commented ·

modelerror.fsm

@Matthew Gillespie, Attached is a screenshot & the stripped version of the model with the same error.

0 Likes 0 ·
errorcapture.png (295.5 KiB)
modelerror.fsm (6.6 MiB)

1 Answer

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered Matthew Gillespie commented

The issue here is that renaming the row headers in the PCI table doesn't really do anything. When you specify a PCI you need to specify which row number you want in the PCI table and not which row name. By default these are the same, but you can rename the row headers if it helps organize your model. However, you can't really use the name to reference the PCI. You'll notice that in the PCI field of the Arrival object, when you click the drop down arrow you'll see a list of the PCI's listed using their names, but when you select the desired PCI it puts the row number into the field and not the name.

So you'll need to swap out the values in your appointments table to use the row number and not the row name.

Since this would be very tedious I wrote a script to do it. Just open a script console (Debug -> Script Console), paste in this code, and click the execute button (green play button):

treenode appointments = node("MODEL:/PA_ThrirdFloor>variables/ScheduledArrivals");
treenode pciTable = node("MODEL:/Tools/PatientBin>variables/PatientClassifications");

for(int i = 1; i <= content(appointments); i++)
{
	treenode appointment = rank(appointments, i);
	treenode pci = rank(appointment, 2);
	string pciName = concat("PCI ", stringreplace(gets(pci), ".00", ""));
	
	for(int j = 2; j <= content(pciTable); j++)
	{		
		treenode pciRow = rank(pciTable, j);
		string rowName = getname(pciRow);
		if(rowName == pciName)
		{
			sets(pci, numtostring(j - 1));
			break;
		}
	}
}

pci.png (18.1 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Cinar Tuncel avatar image Cinar Tuncel commented ·

Thanks. Solved.

0 Likes 0 ·